Fixing AADSTS50011: The Redirect URI Does Not Match the Application
7 min
When signing in to an application using Azure Active Directory, you may encounter this error:
ADSTS50011: The redirect URI '<your app URI>' specified in the request does not match the redirect URIs configured for the application.
This means the URI your app is using to handle the sign-in response does not match any of the redirect URIs configured in the Azure AD App Registration.
Why This Happens
This typically occurs when:
- The Redirect URI in your application configuration differs from what is set in Azure AD.
- You are using a local development URI (e.g., https://localhost:port) or a custom hostname (e.g., https://server.local:port) not registered in Azure AD.
How to Fix It
1. Check the Redirect URI in the Error
The error message will show the redirect URI sent by the app. For example:
https://server:8699/signin-oidc-anywhere
2. Add the Redirect URI in Azure AD
- Sign in to the Azure Portal.
- Go to Entra ID > App registrations.
- Open the affected application.
- Under Authentication, find Redirect URIs.
- Add the exact URI shown in the error (including protocol, host, port, and path).
- Click Save.
3. Ensure HTTPS is Used
Azure AD requires HTTPS for all redirect URIs (except http://localhost for development).
4. Retry Sign-In
After saving the changes, try signing in again.
Additional Notes
- If you have multiple environments (Dev, Test, Prod), add all required redirect URIs to the app registration.
- For local development, you can use http://localhost with a port, but production must always use HTTPS.