Link external account

Hey folks,

we’ve setup a Gitea instance on — and migrated repos, and pull requests and issues from github/Plume-org

now, i can see in my Settings / Security an option to Manage Linked Accounts*, but i don’t see anywhere a way to link an account.

Is there a way to associate igalic (migrated from Github) #790 - cargo release helper - Plume - Gitea: Git with a cup of tea with my user (igalic) on that instance ? an account i created by registering via Github!

…or, Should we have imported users as well in our migration?

have you found the solution ? I have the same problem.

no, we’ve basically given up on having a link between our historic github selves and our current selves :unamused:

Sry for reviving this old thread, but since there is next to no documentation on this, and google brought me to this thread, I think I should share my knowledge so others who have the same problem don’t need to spend hours reading sourcecode to figure this out.

Basically you need to create an authentication source in the administration. Pick OAuth2 as type and name it gitlab (this is very important!); pick as provider also “GitLab”. Fill in clientID and secret of your Oauth application you created in gitlab (see below) and also check “Use Custom URLs”.
Fill in these:

  • Authorize URL: https://<your gitlab domain>/oauth/authorize
  • Token URL: https://<your gitlab domain>/oauth/token
  • Profile URL: https://<your gitlab domain>/api/v3/user

Now to the gitlab side: Go into user>Apllications (or inside the Admin panel>Applications) and create an new OAuth application. Name it like you want; As redirection url you put https://<your gitea domain>/user/oauth2/gitlab/callback.
No clue what exact scopes it really needs but it definitivly works with these settings:

  • Trusted: Yes
  • Confidential: Yes
  • Scopes:
    • read_api
    • read_user
    • profile
    • email
      Save it and copy the clientID and secret over to gitea as mentioned above.

Now the part I’ve (and most others I belive) got really stuck: you need to logout. When going to the login site, you now have an gitlab icon. Click it, you well get redirected to your gitlab account (if not set to trusted, you might need to approve the application or input 2FA or similar thinks), after that you get redirected back to gitea to be greetet by another dialog: you now kan choose if you want to create an account or login to an existing account. If you login using your account it will link your gitlab to your gitea. It also should run an task in the background to update all old references to your gitlab account with your gitea user. If not: go into the administraion setting, Monitoring and execute the cron task “Update migration poster IDs”. This will also trigger the code to update the old id’s.

Note: 1.16.7 has seemingly a bug where oauth currently dosnt work as intended (500 after beeing redirected back to gitea from gitlab), but in the master branch it works definitvely.

Hope I could help somebody :slight_smile:

1 Like

It is worth a bug report with detailed instructions to repeat it.

You should add an OAuth2 Github auth source first, then you should find the button or login with Github will let you binding.