How to authenticate user using GitHub app? #24557
-
I need user to install GitHub app _and_ I need to recognize user session on my web app – the user/ organization who have installed the app. Is there an oauth equivalent flow for installing GitHub apps that allows me to securely identify user? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I have created a GitHub app. I want to authenticate a user of my website using GitHub app. My understanding is that user first needs to install the app, i.e. I link user to https://github.com/apps/myapp/installations/new. After user installs the app, user is redirected to the landing page of my application with I use this My understanding is that now I need to use OAuth to authenticate the user. Therefore, I redirect user to https://github.com/login/oauth/authorize?client_id=%GITHUB_APP_CLIENT_ID%. Because user has already installed my app, user is instantly redirected back to my webpage with Now I use
My problem is that the latter always comes back with HTTP status code 406 response (no response body). My question: * How to authenticate user for GitHub app? |
Beta Was this translation helpful? Give feedback.
-
In case anyone else runs into this, the problem was that I included authorization header. The moment you include the authorization header, currently, the API starts returning 406 response. |
Beta Was this translation helpful? Give feedback.
-
The first time they click the link, they get redirected back with the installation_id. But how does it work the second and third time? Edit: I believe the answer to my own question is:
|
Beta Was this translation helpful? Give feedback.
-
Has anyone contacted support about this? |
Beta Was this translation helpful? Give feedback.
In case anyone else runs into this, the problem was that I included authorization header. The moment you include the authorization header, currently, the API starts returning 406 response.