-
-
Notifications
You must be signed in to change notification settings - Fork 346
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OIDC: Use 'sub' claim to identify the user #759 #772
OIDC: Use 'sub' claim to identify the user #759 #772
Conversation
Using the 'sub' claim allows the user to change their email in the OIDC Identity Provider without loosing their work.
name: this._extractName(userInfo) | ||
name: this._extractName(userInfo), | ||
connectId: userInfo.sub, | ||
loginMethod: 'External', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed the loginMethod: 'External'
is meant to be used for such case.
I can also add this property for UserProfile
s created SAMLConfig.ts if that's relevant.
Thanks for opening the PR @fflorent. The Since they're already being used for a different authentication method, I think it would be safer to add a new column and login method, to avoid unintended consequences in installations that have used both OIDC and GristConnect. @paulfitz what do you think? |
Thanks for the information @georgegevoian! 🙏
Regarding the
I feel like the meaning of
If I understand correctly, you talk about a case where an admin has switched from one to the other without purging the users table. Instead of introducing another column which would have much an analogous role, and having to duplicate much of the logic of
? We can imagine, if that's reasonable, to set the value of the |
Agree that duplication isn't ideal. Related to your idea: currently, the Something like that idea was something we considered in the past (for a feature to improve account linking), but since it was a fairly big change with a lot of cases to think through (for example, how to pick which email to use for |
I see! We may still be able to do a not-so-big refactoring by:
If that make sense, I can start working on it. My biggest apprehension is about the regressions, I don't know how easy it is to find every place to adapt for this work (maybe searching for every PS: Also i guess that we would need to change the |
I tried to understand I don't think we can introduce an assumption of a single login system. Grist SaaS allows two ways to log in already (with email + password, and with Google). As far as the structure of logins, @georgegevoian's idea to add the identifier to the |
As you seem concerned about such a change, I guess that's not a simple task. At the beginning I thought I could manage to implement that quickly (or more or less), however it looks like more ambitious that I thought. May I close the PR? (letting me or anyone reopen-it later when the issue becomes relevant to address for they) |
Hi @fflorent, ok to close the PR. Thanks for having taken a shot at this. |
Context
Resolves #759
When a user change their email in the OIDC Identity Provider and connect again to Grist, a new account is created and they cannot access to their workspace anymore.
Technical considerations
Credits to @illode for the idea.
The
sub
claim in OIDC spec is used to uniquely identify a user, instead of their email (which can be changed).We store it in the
connect_id
field of theusers
table which seems to be made for that and take advantage of it to update the email when required.