Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: use unique ID for linked accounts#3441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sreya merged 35 commits intomainfromjon/userauth
Aug 17, 2022
Merged

fix: use unique ID for linked accounts#3441

sreya merged 35 commits intomainfromjon/userauth
Aug 17, 2022

Conversation

sreya
Copy link
Collaborator

@sreyasreya commentedAug 9, 2022
edited
Loading

This PR fixes some of the logic related to OAuth-related logins.

Behavior updates:

  • This PR restricts user to being able to login with only one login type. That means a user that logs in with Github cannot authenticate to the same account with OIDC.
    • This also means if you logged in as a built-in user (akalogin_type =password) and your admin configured OIDC or Github you cannot "migrate" your account to these new forms of login
  • We can now process updates to a user's email and username in an upstream OIDC provider! Previously if your email was updated and you attempted to log in it would create a new account.

Schema updates:

  • user_links:
    • Added a new tableuser_links which hosts OAuth-related fields (rows are not created for password-based login)
    • A user can haveat most one row perlogin_type (even though they cannot take advantage of that for now)
  • api_keys:
    • Dropped all columns related to OAuth (and migrated touser_links)
  • users:
    • Added alogin_type column. This column is now duplicated betweenuser_linksusers andapi_keys. We could remove it fromapi_keys but it's nice to have when trying to refresh auth tokens.
    • The column is necessary in order to determine whether a user is of login_typepassword so as to prevent them from logging in with an alternative login type.

fixes#3322

@sreyasreya requested review froma team and removed request fora teamAugust 10, 2022 00:41
@sreyasreya marked this pull request as ready for reviewAugust 10, 2022 23:48
@sreyasreya requested a review froma team as acode ownerAugust 10, 2022 23:48
@sreyasreya requested review fromkylecarbs and removed request fora teamAugust 10, 2022 23:48
@sreyasreya requested a review fromkylecarbsAugust 12, 2022 04:56
@sreya
Copy link
CollaboratorAuthor

@kylecarbs I stood up OIDC and tested all the edge cases. Things seem to be working as expected. I'm going to update the PR with a summary of the updated behavior.

@sreyasreya requested a review fromkylecarbsAugust 13, 2022 03:15
@ammario
Copy link
Member

This PR restricts user to being able to login with only one login type. That means a user that logs in with Github cannot authenticate to the same account with OIDC.

What was your rationale for this decision? Kyle says there are bad security implications with the current implementation. Just confirming that we're aligned.

@sreya
Copy link
CollaboratorAuthor

@ammario I think mainly because the emails aren't verified for built-in. There's also some precedent in other services like Gitlab. For example if I sign in using email/password on Gitlab and then try to sign in with Google using the same email I get an error (for what it's worth I wouldn't say that's the standard, LinkedIn let me swap between both although they required email verification). We also didn't allow this in v1 and heard no complaints about that behavior.

I don't know if there's any realistic security implications but if user A is created with email/password, and then User B signs in with OIDC with a matching email, then user B would be logged into user A's account. Is that realistic? Not really but it's just kinda strange that it could happen.

I don't think there are any security implications at all with signing in between OIDC and Github but I know that with this PR we will process upstream updates to a user's email/username in the OIDC provider and reflect those in the product. If we do that with Github as well then you can get in a situation where a user's email and username is flip flopping between two values every time they sign in with a different provider.

I don't feel particularly strongly one way or the other and I do see how it could be useful for existing users to be able to "migrate" their built-in account to OIDC/Github instead of having to create a new account just to take advantage of new forms of login.

@ammario
Copy link
Member

@sreya all SGTM

@sreyasreya merged commitc3eea98 intomainAug 17, 2022
@sreyasreya deleted the jon/userauth branchAugust 17, 2022 23:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@coadlercoadlercoadler approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Link OIDC accounts by unique identifier
4 participants
@sreya@ammario@coadler@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp