-
Notifications
You must be signed in to change notification settings - Fork 33
provider: Only use verified email as username #1249
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1249 +/- ##
=======================================
Coverage ? 80.08%
=======================================
Files ? 20
Lines ? 984
Branches ? 0
=======================================
Hits ? 788
Misses ? 196
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e0092dd to
7954376
Compare
|
The failures of the code sanity jobs are unrelated |
denisonbarbosa
left a comment
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.
Just a small fix that should be easily addressable. Everything else looks great!
authd-oidc-brokers/internal/providers/genericprovider/genericprovider.go
Outdated
Show resolved
Hide resolved
Keycloak allows users to change their email address themselves without verifying it first. The ID token includes an `email_verified` claim which we now check and return an error if it's false, to avoid that users can log in with arbitrary usernames. This method of the genericprovider is also used by the Google provider which also includes the `email_verified` claim in the ID token. The `email_verified` claim is in fact defined as a standard claim in the OIDC spec (which doesn't mean that all IdPs have to set it).
We don't want to return a user info with an empty username in case the email claim is missing in the ID token.
The provider returns the sub claim as the UUID field in the user info, which we store in the token.json. We don't currently use the UUID for anything, but from the provider's perspective it should not return a user info with an empty UUID. However, we should consider removing the UUID field because it's unused which can be confusing.
9df396e to
1ddeea7
Compare
Keycloak allows users to change their email address themselves without verifying it first. The ID token includes an
email_verifiedclaim which we now check and return an error if it's false, to avoid that users can log in with arbitrary usernames.This method of the genericprovider is also used by the Google provider which also includes the
email_verifiedclaim in the ID token.The
email_verifiedclaim is in fact defined as a standard claim in the OIDC spec (which doesn't mean that all IdPs have to set it).UDENG-8970