Managing external identities to enable secure access for partners, customers, and other non-employees
Microsoft Entra B2B: Gmail guest invitation redemption with built-in Google federation fails with AADSTS165000
We are troubleshooting Microsoft Entra External ID B2B collaboration with the built-in Google identity provider. Gmail guests cannot redeem B2B invitations. The redemption flow fails with AADSTS165000 before the user is redirected to the target app.
Service/scenario: Microsoft Entra workforce tenant B2B collaboration Built-in Google identity provider for external users Guest invitation redemption for Gmail users Microsoft Graph POST /invitations and official Microsoft invitation email
Error: AADSTS165000: Invalid Request: The request did not include the required tokens for the user context. One or more of the user context values (cookies; form fields; headers) were not supplied, every request must include these values and maintain them across a complete single user flow. Failure Reasons:[Token was not provided;]
Example diagnostic values: Request ID: bef43cf8-146e-4a07-b243-f69ca8bb0300 Correlation ID: 5ea2cd53-f456-4741-ac42-ed59721f7dd2 Timestamp UTC: 2026-05-05T16:02:44Z
Observed flow:
- User opens Microsoft B2B invitation redemption link.
- Browser reaches invitations.microsoft.com / login.microsoftonline.com.
- Microsoft redirects to Google OAuth.
- Google auth request uses: response_type=code response_mode=form_post scope=openid email profile address redirect_uri=https://login.microsoftonline.com/tenant-id/federation/oauth2
- Browser returns to: https://login.microsoftonline.com/tenant-id/federation/oauth2
- Microsoft shows AADSTS165000.
What works: Normal sign-in through the main sign-in screen with the same built-in Google provider works and reaches Google consent.
What fails: Raw Graph inviteRedeemUrl fails. Official Microsoft invitation email link fails. A brand-new Gmail user on another computer fails. Fresh Chrome profile using --user-data-dir fails. The failure happens before redirecting to our app.
Configuration already checked:
- Built-in Google provider is configured under External Identities ** All identity providers ** Google.
- It is not a custom OIDC provider.
- Google client ID in Entra matches the client_id in the captured Google authorize URL.
- Google client secret was rotated and updated in Entra.
- Google OAuth consent screen is in Production.
- Authorized domain includes microsoftonline.com.
- Earlier Google redirect_uri_mismatch was fixed by adding: https://login.microsoftonline.com/tenant-id/federation/oauth2
- Also tested a clean Google OAuth client with only workforce/B2B redirect URIs: https://login.microsoftonline.com https://login.microsoftonline.com/te/tenant-id/oauth2/authresp https://login.microsoftonline.com/te/tenant-domain/oauth2/authresp https://login.microsoftonline.com/tenant-id/federation/oauth2 https://login.microsoftonline.com/tenant-domain/federation/oauth2
- Cross-tenant access inbound/outbound is allowed.
- Guest invitations are allowed.
- Identity provider precedence is: azureActiveDirectory, externalFederation, socialIdentityProviders
- fallbackIdentityProvider is defaultConfiguredIdp.
- No shadow/custom OIDC provider was found.
Invitation payload tested: POST https://graph.microsoft.com/v1.0/invitations
{ "invitedUserEmailAddress": "gmail-user", "invitedUserDisplayName": "Test User", "inviteRedirectUrl": "https://myapps.microsoft.com", "sendInvitationMessage": true }
Also tested sendInvitationMessage=false and opening returned inviteRedeemUrl directly.
Question: Why does the B2B invitation redemption path fail with AADSTS165000 when normal Google sign-in works with the same built-in Google provider? Is there a tenant-level setting, Google provider object issue, or known Microsoft Entra invitation redemption issue that can cause the federation callback to lose or reject the required token/session context?