add GitHub and GitLab as Oauth2 sources #225

Closed
opened 2020-07-27 21:07:55 +02:00 by 6543 · 21 comments
Image

this would make migration from GitHub/GitLab eaven easyer: user who have created an accounton Codeberg and linked this one with a GitHub account later, will automaticaly take over the ownership of issues/pulls/comments on repos witch had used the build-in Migration tool.

this would make migration from GitHub/GitLab eaven easyer: user who have created an accounton Codeberg and linked this one with a GitHub account later, will automaticaly take over the ownership of issues/pulls/comments on repos witch had used the build-in Migration tool.
Image
Owner

@6543

Personally I would like to support linking the account for issue/pulls/comments migration.

But I would like to do it without enabling "login/register with github". Accounts created that way behaved weird in our and tests by @davidak .

It that possible?

@6543 Personally I would like to support linking the account for issue/pulls/comments migration. But I would like to do it **without** enabling "login/register with github". Accounts created that way behaved weird in our and tests by @davidak . It that possible?
Image
Author

Accounts created that way behaved weird

Noticed too, there is somehow a diffrence if you create fia github or link an account afterwards - but didn't digged into this rabit hole jet

... posible without enabling ... github login ...

sadly: NO

this is the general problem of how to make sure that someone realy own the account X on platform Y

> Accounts created that way behaved weird Noticed too, there is somehow a diffrence if you create fia github or link an account afterwards - but didn't digged into this rabit hole jet > ... posible without enabling ... github login ... sadly: NO this is the general problem of how to make sure that someone realy own the account X on platform Y
Image
Owner

Noticed too, there is somehow a diffrence if you create fia github or link an account afterwards - but didn’t digged into this rabit hole jet

Yes, this is what I mean, I would like to disable "create via github" but keep "link account afterwards". A patch for gitea/codeberg would be neccessary I guess.

> Noticed too, there is somehow a diffrence if you create fia github or link an account afterwards - but didn’t digged into this rabit hole jet Yes, this is what I mean, I would like to disable "create via github" but keep "link account afterwards". A patch for gitea/codeberg would be neccessary I guess.
Image
Author

@ashimokawa if we like to get it with v1.12.x I think a patch will be needed :/

@ashimokawa if we like to get it with v1.12.x I think a patch will be needed :/
Image
Author
upstream issue: https://github.com/go-gitea/gitea/issues/12342
Image 6543 self-assigned this 2021-05-07 15:53:51 +02:00
Image
Author
upstream pull: https://github.com/go-gitea/gitea/pull/15795
Image
Author

ok did we come to the conclusion it's working fine ...?

can be tested on https://codeberg-test.org/ atm :D

ok did we come to the conclusion it's working fine ...? can be tested on https://codeberg-test.org/ atm :D
Image
Owner

Think so, missing thing is some explanation in the docs on how to connect?

Think so, missing thing is some explanation in the docs on how to connect?
Image
Author

well thinks so,

jut the hint we have to make sure...:

  • Github oauth authentification source has te be named github
  • Gitlab oauth authentification source has te be named gitlab
well thinks so, jut the hint we have to make sure...: * Github oauth authentification source has te be named `github` * Gitlab oauth authentification source has te be named `gitlab`
Image
Author

INFO: Codeberg/gitea@0d3874b691 will make it posible, on next deploy 🚀

INFO: https://codeberg.org/Codeberg/gitea/commit/0d3874b6914e512eb9a9b5c48888f6a9c023a2f8 will make it posible, on next deploy :rocket:
Image

I tried to test this and failed, maybe at the CAPTCHA. #483

This would help a lot to convince projects to migrate to codeberg as their users can still contribute easily with github/gitlab account.

I tried to test this and failed, maybe at the CAPTCHA. https://codeberg.org/Codeberg/Community/issues/483 This would help a lot to convince projects to migrate to codeberg as their users can still contribute easily with github/gitlab account.
Image
Owner

I don't know if the login sources are setup properly yet or maybe broken? Testing this is highly appreciated before we rollout to prod, I'm not sure about the current state.

We'll hit this issue up as soon as we get to this topic again ...

I don't know if the login sources are setup properly yet or maybe broken? Testing this is highly appreciated before we rollout to prod, I'm not sure about the current state. We'll hit this issue up as soon as we get to this topic again ...
Image
Author

It should work all fine?

What do you rever to @fnetX ?

It should work all fine? What do you rever to @fnetX ?
Image

It should work all fine?

have you tested it? shouldn't take too long

it fails for me

steps to reproduce:

  1. don't have an account on the test instance
  2. open https://codeberg-test.org/user/login
  3. click Sign In With GitHub
  4. the page "Link to Existing Account" (https://codeberg-test.org/user/link_account) opens
  5. i don't have an account, so i input random characters and click Link account
  6. then i get to the page https://codeberg-test.org/user/link_account_signin where i click the option Register New Account (i don't see it on the first site)
  7. i input my user name (davidak), e-mail und captcha and click "Complete Account"
  8. i get a white page with the text "Forbidden"

the browser console (Chromium 91.0.4472.114) says:

Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.
link_account_signup:1 POST https://codeberg-test.org/user/link_account_signup 403

here is a video that shows the issue and how it works on https://try.gitea.io/

https://peertube.social/videos/watch/eaf0278a-f14c-4018-83cc-0c2a3706dea6

>It should work all fine? have you tested it? shouldn't take too long it fails for me steps to reproduce: 0. don't have an account on the test instance 1. open https://codeberg-test.org/user/login 2. click *Sign In With GitHub* 3. the page "Link to Existing Account" (https://codeberg-test.org/user/link_account) opens 4. i don't have an account, so i input random characters and click *Link account* 5. then i get to the page https://codeberg-test.org/user/link_account_signin where i click the option *Register New Account* (i don't see it on the first site) 6. i input my user name (davidak), e-mail und captcha and click "Complete Account" 7. i get a white page with the text "Forbidden" the browser console (Chromium 91.0.4472.114) says: > Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'. > link_account_signup:1 POST https://codeberg-test.org/user/link_account_signup 403 here is a video that shows the issue and how it works on https://try.gitea.io/ https://peertube.social/videos/watch/eaf0278a-f14c-4018-83cc-0c2a3706dea6
Image
Owner

Yeah this isn't the supposed workflow. It's not described, because it's not on prod yet.

You have to register an account first, then sign-in with GitHub and link it.

Maybe this can be changed, but it's not the way it's supposed to work.

It's at least a bug that you see the sign-up tab after entering non-working credentials ...

Yeah this isn't the supposed workflow. It's not described, because it's not on prod yet. You have to register an account first, then sign-in with GitHub and link it. Maybe this can be changed, but it's not the way it's supposed to work. It's at least a bug that you see the sign-up tab after entering non-working credentials ...
Image

whats the point in "sign in with github" if i need to register locally anyway?

whats the point in "sign in with github" if i need to register locally anyway?
Image
Owner

You can link your account with migrated content. The issues do not longer show some random GitHub user, but your account etc ...

If possible, I personally don't object to logging in with GitHub, but we had issues with having access to the users mail address IIRC ...

You can link your account with migrated content. The issues do not longer show some random GitHub user, but your account etc ... If possible, I personally don't object to logging in with GitHub, but we had issues with having access to the users mail address IIRC ...
Image
Author

hmm https://codeberg-test.org/user/link_account_signin should return 404 or better redirect to normal signup

hmm `https://codeberg-test.org/user/link_account_signin` should return 404 or better redirect to normal signup
Image
Author

done 🚀

done 🚀
Image 6543 closed this issue 2021-09-11 22:08:13 +02:00
Image

It works now to link an existing account.

Tested on https://codeberg-test.org/.

Would be great if one could create an account just from GitHub login. So UX would be:

  1. Click "Login with GitHub"
  2. Allow to use user data from GitHub
  3. You are logged in with your new account

It uses the e-mail github has and you can reset your password with that address if github would disappear.

It works now to link an existing account. Tested on https://codeberg-test.org/. Would be great if one could create an account just from GitHub login. So UX would be: 1. Click "Login with GitHub" 2. Allow to use user data from GitHub 2. You are logged in with your new account It uses the e-mail github has and you can reset your password with that address if github would disappear.
Image
Author

@davidak another issue - "enable auto account creation on oauth login" ... ;)

@davidak another issue - "enable auto account creation on oauth login" ... ;)
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#225
No description provided.