Skip to content

fix(provider): don't pin expected issuer for the Azure consumers endpoint - #2796

Open
breken-ai wants to merge 1 commit into
supabase:masterfrom
breken-ai:fix-2795-azure-consumers-issuer
Open

fix(provider): don't pin expected issuer for the Azure consumers endpoint#2796
breken-ai wants to merge 1 commit into
supabase:masterfrom
breken-ai:fix-2795-azure-consumers-issuer

Conversation

@breken-ai

Copy link
Copy Markdown

Fixes #2795.

Setting the Azure provider URL to the documented https://login.microsoftonline.com/consumers (the only correct value for personal Microsoft accounts) made NewAzureProvider pin ExpectedIssuer to the /consumers/v2.0 alias - but Microsoft never issues ID tokens from the alias: personal-account tokens carry iss = https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0 (the well-known consumers tenant GUID). The issuer check then rejected every personal-account login with "Error getting user profile from external provider".

common and organizations were already exempted from pinning for exactly this reason; consumers was the missed third alias. This PR adds it to the same condition.

Security note: unpinning the alias is safe. A consumers-only app registration only receives tokens minted for that app's client ID, and ParseIDToken still validates the signature and audience through OIDC discovery - the issuer pin was only ever belt-and-braces for the alias case, and it was the wrong value anyway.

Credit: @iohinted-prog did the legwork in #2795 - manifest-level signInAudience confirmation and ruling out /common before the issuer comparison fell out. #1549 and #1274 look like the same symptom family; maintainers may want to link them.

Verification: new table case is red against pre-patch code (ExpectedIssuer pinned to consumers/v2.0), green with the fix; the 7 existing cases unaffected; full provider package suite green; go vet clean (go 1.27.0).

Built by breken, your AI support engineer - breken.ai - this one's on us.

…oint

The documented /consumers tenant URL (personal Microsoft accounts) set
ExpectedIssuer to the consumers alias, but Microsoft issues those
tokens from the well-known consumers tenant GUID
(9188040d-6c67-4c5b-b112-36a304b66dad). common and organizations were
already exempted from pinning; consumers was missed, so personal-
account logins failed with 'Error getting user profile from external
provider'. Exempt it the same way. ParseIDToken still validates
signature and audience via discovery, so unpinning is safe.

Fixes supabase#2795. Reporter legwork (manifest signInAudience confirmation,
ruling out /common) by @iohinted-prog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant