0
votes

I have .Net Core 3.1 MVC project in linux container. I deployed it on Azure App Service and setup Azure Active Directory authentication. Local everything work good, but on server I have a problem "The reply URL specified in the request does no match the reply URLs confiqured for the application". As I see AD returnUrl = http://site.azurewebsites.net, but I setup Redirect Urls like https://site.azurewebsites.net

My Azure Active Directory enter image description here My App Service Authentication enter image description here

1

1 Answers

0
votes
  • This issue could be resolved once you have same URLS at both places in app registration and also make sure to clear cache.(Also check if the protocol for both uris is same i.e;Https)
  • You can see the reply url/redirect uri during sign-in /Authentication request in the address bar of the browser on the error screen (Recommended to use Chrome or Edge browser).If it is SAML request, Assertion Consumer Service represents the reply url. enter image description here

Something in below format For OpenId Connect: https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=76f00765-7657-66hg-ag19-34s653ad0a65&redirect_uri=https://www.contoso.com/signin-oidc

enter image description here

  • So check if this redirect uri of your app(in the authentication request which maybe present in helper class of your application ) matches redirect uri in AAD in app registration URI .If not ,correct it or add it. See if callback path in appsettings.json is “/signin-oidc” as url must be in “/signin-oidc” format
  • If You have url in app registration like say>>https://localhost:44324/signin-oidc, then you must be testing it from local machine which is running on 443
  • Since its working locally and issue is only with Server, it may be due to https 443 firewall block.So try to Allow 443 port (on test server) and try the mentioned steps.

If you want to determine what is the redirect uri present you may try in Fiddler .