Github Authentication

This post was flagged by the community and is temporarily hidden.

Well, the error says the username or password is not correct.

Have you had 2FA enabled on GitHub.com? If so, I think you would need to create personal access token as password.

This post was flagged by the community and is temporarily hidden.

This error occurs when the source ID is different, you can change the authentication source of a user in the /admin/users/:id page.


Just to confirm, are you the owner of this user?: https://github.com/gituser

Ok, I delete folder custom/conf/auth.d and add source from Admin Panel -> Authentications -> Add New Source, then fill form:

Authentication Type : Github
Authentication Name: Github
API Endpoint: https://api.github.com/

Then uncheck “This Authentication is default login source” and click on Add New Source.

Then I go on github.com and open new account, and I back on my git server and I got success login. But when I try to login with my account from Github (same username on local source) I still have error with “source is not associated”.

Can you verify with an admin account that the user you’re trying to login has desired Authentication Source from this dropdown list?

That user is admin user (id=1) , but I giveup of this. This Auth source with Github have bug and can’t to fix.

When I login with another account from github for example username “korisnik” Gogs make local user korisnik in list of users, but if I login with e-mail [email protected] Gogs not see relation Github username or mail (same account) and I have 2 users in Gogs one korisnik and another [email protected].

Well, you can still check the values in users table from database.

Github username= mjurisic777 , [email protected]

  1. When she login with username mjurisic777 I got new record in database (row 3) - with wrong e-mail address.
  2. Then she login with e-mail I got new record in database (row 4) - with also wrong e-mail address field

I’m in confuzion.

Thanks! The screenshot is very helpful, I think I’ve found the problem:

(The account fetch will always fail because the username is already empty).

Sorry about confusion! I will work on it ASAP. Created issue here: https://github.com/gogs/gogs/issues/5968

OK, I debugged a bit, the reason Gogs can’t get email from GitHub.com is because the user does not set public email on GitHub.com. According to https://developer.github.com/v3/users/#get-a-single-user.