Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting “Integration not found” when using app id returned from /orgs/{org}/installations endpoint #165

Open
rpivovar-godaddy opened this issue Feb 17, 2022 · 2 comments
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects

Comments

@rpivovar-godaddy
Copy link

If this is the wrong place to post this issue, happy to post this elsewhere --

I’m trying to instantiate Octokit with authStrategy createAppAuth with an app ID that I’ve retrieved by using the /orgs/{org}/installations endpoint. I used this endpoint by instantiating Octokit using a personal access token.

After listing installed apps, I could see the app in the returned JSON list that I wanted to use for the createAuthApp authStrategy. I copied its app ID from the app_id field.

I then went into the settings for the app and generated a brand new private key.

For testing purposes, I’ve stored my private key in my js file like this:

const privateKey = `
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
`.trim()

I then try to instantiate Octokit with the private key and the app ID.

const appOctokit = new Octokit({
  authStrategy: createAppAuth,
  auth: {
    appId: 1,
    baseUrl, // I'm using this same baseUrl when instantiating with personal access token
    privateKey
  }
});

Then I try to make a request to the /app endpoint with this new instance:

const { data } = await appOctokit.request('/app');
console.log(data);

I get this error, though: RequestError [HttpError]: Integration not found

After creating a private key for an app ID that appears to exist when using the /orgs/{org}/installations endpoint, it appears that I can’t find the app when instantiating with the createAppAuth helper.

Am I doing something wrong here?

Thanks for the help!

@ghost ghost added this to Inbox in JS Feb 17, 2022
@wolfy1339 wolfy1339 added the Type: Support Any questions, information, or general needs around the SDK or GitHub APIs label Dec 16, 2022
@wolfy1339 wolfy1339 moved this from Inbox to Support in JS Dec 16, 2022
@palmobar
Copy link

I'm having the same issue and have no idea how to proceed further.

@gr2m
Copy link
Contributor

gr2m commented Feb 24, 2023

@palmobar are you also setting baseUrl?

I would usually recommend to use the App SDK instead of Octokit + appAuth strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
No open projects
JS
  
Support
Development

No branches or pull requests

6 participants
@gr2m @wolfy1339 @rpivovar-godaddy @palmobar and others