Skip to content

Conversation

@adombeck
Copy link
Contributor

@adombeck adombeck commented Feb 6, 2026

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).

UDENG-8970

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@55e6ba5). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adombeck adombeck force-pushed the UDENG-8970-verified-email branch from e0092dd to 7954376 Compare February 6, 2026 15:51
@adombeck adombeck changed the title provider: Don't use unverified email as username provider: Only use verified email as username Feb 6, 2026
@adombeck adombeck marked this pull request as ready for review February 9, 2026 13:16
@adombeck
Copy link
Contributor Author

adombeck commented Feb 9, 2026

The failures of the code sanity jobs are unrelated

Copy link
Member

@denisonbarbosa denisonbarbosa left a 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!

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.
@adombeck adombeck force-pushed the UDENG-8970-verified-email branch from 9df396e to 1ddeea7 Compare February 9, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants