Search code examples
azure-active-directoryangular7adalmicrosoft-adal-angular6

The Reply URL specified in the request does not match the reply URL's configured for the application


I am currently using Microsoft adal angular for Azure active directory authentication and below if the configuration settings for the same.

MsAdalAngular6Module.forRoot({
    tenant: 'xxxxxxxxxxxxxxxxxxx',
    clientId: 'xxxxxxxxxxxxxxxxx',
      redirectUri: window.location.origin,
      endpoints: {
      "xxxxxxxx": "xxxxxxxxxxxxxx",
       },
      navigateToLoginRequestUrl: true,
      cacheLocation: 'localStorage',
      loadFrameTimeout: 60000

    }),

I have set reply URL as https://xxx.azurewebsites.net/ in Azure app registrations.

The above configuration works fine if I use https://xxx.azurewebsites.net/ and enter into the application. But when I use https://xxx.azurewebsites.net/dashboard and enter my credentials it is throwing the error mentioned in the subject and not allowing me to go in.

I know that the Azure has blocked wild card configurations in Active directory. Is there a way for me to configure the settings to successfully authenticate If I copy-paste any deep link from the application.

Any help would be really appreciated and thanks in advance.


Solution

  • When the redirect_uri in the authorization request mismatches the redirect url configured in Azure AD registrations, you will encounter this error.

    So if you want to use https://xxx.azurewebsites.net/dashboard in your request, you should also add it as the redirect url of your Azure AD registrations.


    Update:

    Based on our discussion, you just need to specify the redirect URL in your code as the same url as what you have configured in your Azure AD app: https://xxx.azurewebsites.net to meet your requirement.