How to obtain a token that is scoped to allow the installation of a GitHub App #56922
Replies: 1 comment
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I am developing GitHub app, and rather then have the user visit https://github.com/app/my-github-app/installations/new and select which repositories they want to install the app in. I would prefer to handle this myself in my own app. The user grants my application an access token using OAuth2, I then use that token to add my app to the repository.
My initial approach was to get an access token via an OAuth App which scopes of "admin:user", "read:user", "admin:org", "read:org". I would then use this token to install a repository as shown here, but this does not work.
It appears you can only use a PAT token to add a repository
I then found the following Generating an installation access token for a GitHub App
But it appears this only works after an installation is already in place.
Beta Was this translation helpful? Give feedback.
All reactions