Skip to content

Resource not accessible by integration -- getting permissions to other organizations #1624

Answered by gr2m
blackgirlbytes asked this question in Q&A
Discussion options

You must be logged in to vote

but is there a way to get permissions for the GitHub App to make this call GET /orgs/{org}/teams/{team_slug}/memberships/{username} in a different organization

You can retrieve an octokit instance authenticated as the app by doing this

const appOctokit = app.auth()

Once authenticated as the app, you can find out the installation ID for the org you are interested in

https://docs.github.com/en/rest/reference/apps#get-an-organization-installation-for-the-authenticated-app
const { data: installation } = await appOctokit.request('GET /orgs/{org}/installation', {
  org: 'myorg'
})

With the installation object, you can create a new instance for that installation

const myOrgOctokit = app.auth(i…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@blackgirlbytes
Comment options

@gr2m
Comment options

Answer selected by blackgirlbytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants