AuthTrace › Guides

Fix AADSTS50011 and redirect_uri mismatch errors

The user clicks "Sign in" and the identity provider stops them straight away, before any password prompt: AADSTS50011: The redirect URI '…' specified in the request does not match the redirect URIs configured for the application. Other providers say the same thing in their own words:

ProviderTypical message
Microsoft Entra IDAADSTS50011 - redirect URI (OIDC/OAuth) or reply URL (SAML) does not match
GoogleError 400: redirect_uri_mismatch
OktaThe 'redirect_uri' parameter must be a Login redirect URI in the client app settings
Auth0Callback URL mismatch
KeycloakInvalid parameter: redirect_uri

What it means

An app tells the identity provider where to send the user back: the redirect_uri parameter in an OpenID Connect or OAuth request, or the AssertionConsumerServiceURL in a SAML AuthnRequest. The provider only sends codes, tokens or assertions to addresses registered on the app beforehand - otherwise anyone could start a sign-in for your app and collect the result at their own URL. Registered addresses are compared as exact strings, with very few exceptions.

Find the exact value the app sent

The error page usually quotes it, but URL-encoded and sometimes truncated. To get it exactly:

  1. Open DevTools on the app tab, choose the AuthTrace panel, and click Sign in.
  2. Select the authorize request (or the SAML AuthnRequest). AuthTrace decodes it and shows redirect_uri or AssertionConsumerServiceURL as plain text, with the provider's error explained next to it.
  3. Compare it character by character with the list registered on the app.

Without AuthTrace: Network panel › the request to /authorize (Entra: login.microsoftonline.com/…/oauth2/v2.0/authorize) › Payload › redirect_uri.

The usual differences

Where to register it

Changes can take a few minutes to apply. If the error persists, sign in again in a fresh private window so a cached error page isn't fooling you.

Better: fix the app, not the list

If the value the app sends is wrong (http behind a proxy, an internal hostname), registering it just spreads the mistake - and an http:// redirect URI on a public host is a security risk. Register the public HTTPS URL and fix the app so it sends that.

Once the redirect works, the next step can still fail at the token endpoint with invalid_grant if the token request sends a different redirect_uri - see fixing invalid_grant.

More guides