githubgithub-apigithub-app

Github Apps: Authorize & Request on applications doesn't return code parameter


I've created a Github app with the option "Request user authorization (OAuth) during installation".

When a user requests his admin to install the app, the admin accepts and gets back to the app. I then get a url like:

http://localhost:3000/auth/github/callback?code=a22757013d09ccc5f6ed&installation_id=18334019&setup_action=install&state=MYAPPSTATE

BUT when the user Authorize & Request and he gets back to the app I only get a url like so:

http://localhost:3000/auth/github/callback?setup_action=request&state=MYAPPSTATE

My question is, how to get Github to give me the code parameter so I can know which user has requested to install the github app ?

Thank you 🙏


Solution

  • Here is the response I got from GitHub support:

    The code parameter is only returned for authorization during installation. There isn't a way to generate one for the user who has requested an admin to approve, authorise and install.

    As an organization owner/admin, you should see on the GitHub App review install page the user who has made this request during the application installation. You can also check the integration_installation_request.create logs in the organization to find the user who has requested the installation