Skip to content

Conversation

@sreecharan-desu
Copy link

@sreecharan-desu sreecharan-desu commented Jan 24, 2026

Mozilla Connect requires email and email_verified claims in the ID Token to authenticate (it throws a 401 otherwise).

I updated grant.js to explicitly include these claims in the id_token payload when the email or profile scope is requested.

Fixes #18854

Because

Khoros (Mozilla Connect) expects these claims to verify identity. Without them, login fails.

This pull request

  • Updates generateIdToken in packages/fxa-auth-server/lib/oauth/grant.js to include email and email_verified in the token if we have the right scopes.
  • Adds unit tests to packages/fxa-auth-server/test/oauth/grant.js to verify the claims are added correctly and restricted to the proper scopes.

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

@sreecharan-desu sreecharan-desu requested a review from a team as a code owner January 24, 2026 03:56
Mozilla Connect (and potentially other SPs) requires email and email_verified claims in the ID Token to successfully authenticate users. This change ensures these claims are included when the email or profile scope is requested.

This also adds unit tests to verify the claims are only included when appropriate scopes are authorized.

Closes: mozilla#18854
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.

Mozilla connect logins failing with 401

1 participant