Repository navigation
Conversation
A token requested only for Outlook resources (for example https://outlook.office.com/SMTP.Send or IMAP.AccessAsUser.All) has outlook.office.com as its audience, so GET graph.microsoft.com/v1.0/me fails with 401 and the callback errors out. For such scopes, skip the profile request and build raw_info from the access token's claims, mapped onto Graph's field names so 'info' and the domain verifier keep working. The scope configured on the strategy is now also considered when the request does not pass one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the requested scopes only target Outlook resources, for example `offline_access https://outlook.office.com/SMTP.Send\` or `https://outlook.office.com/IMAP.AccessAsUser.All\` for XOAUTH2 SMTP/IMAP, the access token's audience is `outlook.office.com`. `GET https://graph.microsoft.com/v1.0/me\` then fails with 401 and the callback errors out.
This change:
The claims are decoded without signature verification. The token was just received from Microsoft's token endpoint over TLS, and Microsoft doesn't publish keys for verifying tokens issued for its own APIs.
With these scopes the auth hash usually has no email. With `skip_domain_verification` enabled, that depends on the nil guard in #56.
🤖 Generated with Claude Code