What's to be set as Authorization callback URL for a github authentication? #1482

Closed
opened 2025-11-02 04:02:06 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @funkyfuture on GitHub (Jan 29, 2018).

Description

the docs seem to lack information how the Authorization callback URL has to be configured when setting up a GitHub application as authentication backend (https://github.com/settings/applications/…). i'll amend it to the docs when resolved.

Originally created by @funkyfuture on GitHub (Jan 29, 2018). ## Description the docs seem to lack information how the *Authorization callback URL* has to be configured when setting up a GitHub application as authentication backend (https://github.com/settings/applications/…). i'll amend it to the docs when resolved.
GiteaMirror added the type/question label 2025-11-02 04:02:06 -06:00
Author
Owner

@lafriks commented on GitHub (Jan 29, 2018):

Have not tried but looking at source it should be <YOUR_ROOT_URL>/oauth2/<PROVIDER_NAME>/callback

@lafriks commented on GitHub (Jan 29, 2018): Have not tried but looking at source it should be `<YOUR_ROOT_URL>/oauth2/<PROVIDER_NAME>/callback`
Author
Owner

@lunny commented on GitHub (Jan 30, 2018):

I remember there a tip on the configuration UI?

@lunny commented on GitHub (Jan 30, 2018): I remember there a tip on the configuration UI?
Author
Owner

@funkyfuture commented on GitHub (Jan 31, 2018):

sorry, but my deployment setup changed and it will not include such sunctionality, so can't give feedback whether @lafriks's hint is correct.

I remember there a tip on the configuration UI?

no, there was none, but it would be good to have that.

@funkyfuture commented on GitHub (Jan 31, 2018): sorry, but my deployment setup changed and it will not include such sunctionality, so can't give feedback whether @lafriks's hint is correct. > I remember there a tip on the configuration UI? no, there was none, but it would be good to have that.
Author
Owner

@soakes commented on GitHub (Nov 27, 2018):

Hi Guys,

I have just successfully added my Gitea installation so that you can login using github credentials.

Its very similar to how Jenkins is done and heres the solution.

First login to github and create a new Github app for your org.

Next use the following:

GitHub App name (mgmt.example.com/git)
Homepage URL (https://mgmt.example.com/git).
User authorization callback URL (https://mgmt.example.com/git/user/oauth2/github/callback)
Webhook URL (https://mgmt.example.com/git)

Save the changes and create the private key.

Note: Webhook URL shouldn't be needed but wasn't accepting without putting something in here.

Next install the github app.

This concludes the github part.

Note: When asked to give permissions to the GitHub app, you only need Organization members found under Permissions section and Emails under Users section. Both of these should be set to read only.

Now login to your gitea install https://mgmt.example.com/git and goto site administration. Add a new authentication source and use the following details.

Authentication Name (github)
OAuth2 Provider (GitHub)
Client ID (Key) (enter your ID found on your GitHub app you created)
Client Secret (enter your Secret found on your GitHub app you created)

Now active the changes and open a private browser window and try logging into your Gitea install. It should now have an option to login as GitHub user, select this and enter your github creds, it then should ask you to login with your usual Gitea creds so that it can link. This only needs to be done once.

Thats all folks, enjoy GitHub based auth :)

@soakes commented on GitHub (Nov 27, 2018): Hi Guys, I have just successfully added my Gitea installation so that you can login using github credentials. Its very similar to how Jenkins is done and heres the solution. First login to github and create a new Github app for your org. Next use the following: **GitHub App name** (`mgmt.example.com/git`) **Homepage URL** (`https://mgmt.example.com/git`). **User authorization callback URL** (`https://mgmt.example.com/git/user/oauth2/github/callback`) **Webhook URL** (`https://mgmt.example.com/git`) Save the changes and create the private key. **Note:** Webhook URL shouldn't be needed but wasn't accepting without putting something in here. Next install the github app. This concludes the github part. **Note**: When asked to give permissions to the GitHub app, you only need `Organization members` found under `Permissions` section and `Emails` under `Users` section. Both of these should be set to `read only`. Now login to your gitea install `https://mgmt.example.com/git` and goto site administration. Add a new authentication source and use the following details. **Authentication Name** (`github`) **OAuth2 Provider** (`GitHub`) **Client ID (Key)** (`enter your ID found on your GitHub app you created`) **Client Secret** (`enter your Secret found on your GitHub app you created`) Now active the changes and open a private browser window and try logging into your Gitea install. It should now have an option to login as GitHub user, select this and enter your github creds, it then should ask you to login with your usual Gitea creds so that it can link. This only needs to be done once. Thats all folks, enjoy GitHub based auth :)
Author
Owner

@funkyfuture commented on GitHub (Nov 27, 2018):

@soakes your knowledge is certainly better re-usable if added to the docs. ;-)

@funkyfuture commented on GitHub (Nov 27, 2018): @soakes your knowledge is certainly better re-usable if added to the docs. ;-)
Author
Owner

@soakes commented on GitHub (Nov 28, 2018):

Will see what I can do when I get a few minutes or someones welcome to add for us.

@soakes commented on GitHub (Nov 28, 2018): Will see what I can do when I get a few minutes or someones welcome to add for us.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1482