Skip to content

fix: use custom profile/email scopes and userinfo endpoint under strict mode - #17

Draft
adamflitney wants to merge 2 commits into
mainfrom
fix/next-js-better-auth-strict-mode-scopes
Draft

fix: use custom profile/email scopes and userinfo endpoint under strict mode#17
adamflitney wants to merge 2 commits into
mainfrom
fix/next-js-better-auth-strict-mode-scopes

Conversation

@adamflitney

@adamflitney adamflitney commented Aug 25, 2026

Copy link
Copy Markdown

Auth0's strict third-party security mode drops openid/profile/email and disables the native /userinfo endpoint for third-party clients, so this example was silently losing profile/email data (and would in fact load an error page when you tried to log into a strict mode client). Switches to Yoto's user:profile:view/user:email:view scopes and custom /userinfo endpoint, sets authorizationUrl/tokenUrl explicitly instead of discoveryUrl, and enables PKCE (both needed for strict mode clients)

Validated end-to-end against a real strict-mode third-party client in test env: confirmed the original config fails with user_info_is_missing, and this fix resolves the session correctly. Depends on (the new scopes) being deployed.

adamflitney and others added 2 commits August 25, 2026 14:34
…ct mode

Auth0's strict third-party security mode drops openid/profile/email and
disables the native /userinfo endpoint for third-party clients, so this
example silently lost profile/email data. Switches to Yoto's own
user:profile:view/user:email:view scopes and custom /userinfo endpoint,
sets authorizationUrl/tokenUrl explicitly instead of discoveryUrl (which
would otherwise overwrite the userInfoUrl override), and enables PKCE
(required unconditionally under strict mode, even for confidential clients).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant