Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

AADSTS50011: The reply URL specified in the request does not match — after a hosted application moves address

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

After a business application moves to a new server or hosting address, sign-in fails with AADSTS50011. Microsoft Entra ID received a request whose reply URL (also called the redirect URI) is not on the list registered for the application. Copy the address shown in the error, add exactly that address to the application's registration, wait a few minutes and try again.

When the address in the error is the one you intend the application to use, the fix is to register it in Entra ID. When it is not, correct the application's own configuration instead (the steps below tell you which case you are in).

What the error means

After a user signs in, Entra ID sends them back to the application at a redirect URI that the application named in its request. For security, Entra "won't redirect users or send tokens to a URI that isn't added to the app registration", according to Microsoft's redirect URI page. If the address in the request matches none on the list, the sign-in stops with AADSTS50011. If it matches, the user is sent on.

The redirect URI page gives an example of a production address: "a public endpoint where your app is running, like https://contoso.com/auth-response". When an application moves to a new name, a new path or a new port, the address it sends changes, and the registered list is now out of date. A hosting move matters only because it changes the address.

The message differs by protocol, and the fix location differs with it.

For an application using OpenID Connect or OAuth 2.0 the error reads:

Error AADSTS50011 - The redirect URI <Redirect URI> specified in the request does not match the redirect URIs configured for the application <AppGUID>. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

For a SAML-based single sign-on application it reads:

Error AADSTS50011 - The reply URL does not match the reply URLs configured for the application <GUID>. Make sure the reply URL sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/urlMismatchError to learn more about how to fix this.

In the SAML case, the page says the AssertionConsumerServiceURL value in the SAML request does not match the Reply URL value or pattern configured in Microsoft Entra ID. The reply URL is also known as the redirect URI, and the values depend on the application; get them from the application vendor.

Likely causes

Cause What you see How to confirm
The new address was never added to the app registration (OIDC/OAuth 2.0) Redirect URI in the error shows the new host or path Authentication blade of the app registration does not list it
The new address was never added as the SAML Reply URL (Assertion Consumer Service URL) Error mentions the reply URL; the SAML request's AssertionConsumerServiceURL is the new address Basic SAML Configuration on the enterprise application
The address differs in case or scheme Looks the same to a person, still rejected Compare the URI in the error with the entry character by character; paths are case-sensitive
The URI was added to the wrong platform type Added under a platform that does not match the application type Platform configurations on the Authentication blade against the application type
The URI was added to a service principal rather than the application object Value disappears after a sync Microsoft says to add redirect URIs to the application object only
The application itself sends an address that was never intended The URI in the error is wrong, not the registration Application configuration: the page says to update the code or configuration if the address sent is not the desired one

Prove the cause before changing anything

Read these before editing anything.

  1. Copy the whole error text, including the address and the application GUID.
  2. Compare the address with what you intend the application to use after the move. If they differ, the application's configuration is wrong; fix that, not Entra.
  3. In the Azure portal, search for and select App registrations and find the application by the ID in the error.
  4. Select Authentication. Under Platform configurations, read every redirect URI listed. Write the list down.
  5. For SAML: in the Microsoft Entra admin center browse to Entra ID > Enterprise apps > All applications, select the application, then Single sign-on, and read Basic SAML Configuration, including Reply URL (Assertion Consumer Service URL).
  6. Check the rules on the redirect URI page: URIs must begin with https (http is supported only for localhost); they are case-sensitive; a URI with no path is returned with a trailing slash; special characters - ! $ ' ( ) , ; and internationalised domain names are not supported.

Example (illustrative): Contoso (contoso.com.au) moves its leave-request web application from rds01 to a hosting provider. The old redirect URI was https://leave.contoso.com.au/signin-oidc. After the move the application is reached at https://staff.contoso.com.au/signin-oidc. Users sign in, then see AADSTS50011 quoting the new address. The registration lists only the old one. Adding the new address fixes it. The old address stays on the list until the cutover is complete and the old server is switched off.

Fix

Risk: adding a redirect URI widens where Entra will send tokens. Add only addresses you control. Save first: record the current list of redirect URIs (OIDC and OAuth 2.0) or the current Reply URL value (SAML). Back-out for OIDC and OAuth 2.0: remove the address you added and save. Back-out for SAML: put the saved Reply URL value back in Basic SAML Configuration and select Save.

For OIDC and OAuth 2.0 applications (Microsoft's OpenID troubleshooting page):

  1. Copy the application ID from the error message.
  2. In the Azure portal, find the application registration with that ID. The page notes you need to sign in with an account that has permission to update application registrations.
  3. Select Authentication. In Platform configurations, select Add URI and enter the redirect URI shown in the error.
  4. Save, wait three to five minutes for the change to take effect, then send the login request again. If the Entra sign-in page does not appear, clear the password cache from the browser or use InPrivate browsing, as the page advises.

For SAML applications (Microsoft's SAML troubleshooting page):

  1. Make sure the AssertionConsumerServiceURL in the SAML request matches the Reply URL value or pattern in Microsoft Entra ID.
  2. Disruptive step: this replaces a live value, so the old address stops working at once. Save first: the Reply URL value recorded above. In Basic SAML Configuration, select Edit, set Reply URL (Assertion Consumer Service URL) to the address the application sends, and select Save. Users whose requests still carry the old address get AADSTS50011 from that moment.

Disruptive step: removing the old address from the OIDC or OAuth 2.0 list. After the old address is removed, users who still reach the application at the old address get AADSTS50011. Remove it only when the old address is retired. Save first: record the list. Back-out: add the old address again and save, then wait a few minutes.

Respect the limits on the page: 256 redirect URIs for work or school accounts, 100 when personal Microsoft accounts are included, and no more than 256 characters per URI. If the address the application sends is not the one you want, update the application's code or configuration instead.

Confirm the fix

  1. For the OpenID case, wait three to five minutes after saving; for SAML, sign in again once the change is saved. Use a new private browser window.
  2. Confirm the application opens after sign-in, not just that the error has gone.
  3. Test with one user who has used the application before and one who has not.
  4. Ask one user to confirm the address in the browser bar is the new one after sign-in.

What to watch afterwards

  • Other addresses the application may use later, such as a second hostname for testing. Use separate app registrations for development and production, as the page suggests, so test addresses are not exposed on the production registration.
  • The old address on the list: remove it once the old server is retired, and not before.
  • Reports of AADSTS50011 from users in the first few days after the change; a second address that was missed shows up that way.

Risks and limits

  • No commands are given. The portal steps have not been run or lab-tested.
  • If a reverse proxy, load balancer or custom domain sits in front of the application and the address the application sends is not the public one, the fix is in the application's configuration, not in Entra.
  • For OpenID and OAuth 2.0 applications Microsoft's page says changes take three to five minutes to take effect; for SAML it gives no figure, so allow a few minutes.
  • Do not add redirect URIs to a service principal; the redirect URI page says they can be removed when the objects sync.

Sources