4

I got a web app I'm trying to sync with its' App registration I've created and I can't really see the problem. The redirect URL specified in the app is the same as the one I'm trying to connect with, I've made sure of that and also I made sure that on the Authentication section in the App registration that exact URL is listed on the Redirect URIs list, which is what I've seen to be the problem on many similar tickets but that didn't seem to solve my case. Anyone has an idea of anything else I could check?

teamdever
  • 309
  • 6
  • 21
  • 3
    When the app redirects you to log in, inspect the URL. It will contain a "redirect_uri" query parameter. Check its value. That is what Azure AD is checking for, most likely the value is not what you expect. – juunas Jul 05 '21 at 08:49
  • @juunas You're right it's actually an incorrect value. Where can I edit this in that case? – teamdever Jul 05 '21 at 10:11
  • Where have you configured the authentication? In code? App Service Authentication? – juunas Jul 05 '21 at 12:37

1 Answers1

3

As said by @juunas,

Check for the Authentication request in the address bar of the Microsoft login page.

See if that redirect_uri matches with the reply_uri/redirect url in Azure AD (Sign into portal.azure.com => Navigate to Azure Active Directory in the left side bar > App registrations > Your app > Authentication > Redirect URIs.).

Try to check the redirect uri where you configured in your Web api (ex: App settings.json or in conrollers or views)

example: If you see redirect uri like below for app settings:

  

"CallbackPath": "/signin-oidc",
"SignedOutCallbackPath ": "/signout-callback-oidc",
"RedirectUri ": "https://mywebapp.mycompany.com/signin-oidc",
"PostLogoutRedirectUri": "http://mywebapp.mycompany.com/signout-callback-oidc",

If both the redirect uris(AAD and web app) don't match , try to paste the same redirect uri from portal into this app settings redirect uri parameter or say the helper class of your app which is responsible for authentication request. Also see this thread for other work arounds.

kavyaS
  • 8,026
  • 1
  • 7
  • 19