Authenticating through Azure Active Directory in a Web App

I've been following guide on authenticating my web app through Azure Active Directory.

My task is just simply Displaying the user's Full name and/or Email after login with Azure Active directory.

I've been able to make it work locally and registering my app in https://apps.dev.microsoft.com. However, adapting everything to app service context breaks it.

Some questions pops in my mind.
1. What is the essence of the Reply URL?
2. Should I reflect the Reply URL in the appsettings.json?

2 answers

  • answered 2018-10-23 01:34 SunnySun

    What is the essence of the Reply URL?

    In the case of a web API or web application, the Reply URL is the location to which Azure AD will send the authentication response, including a token if the authentication was successful. For the details, please read here.

    Should I reflect the Reply URL in the appsettings.json

    For this guide, you do not need this in the appsettings.json. You just need to replace the values of domain name,tenantid and clientid in the appsettings.json.

    .

  • answered 2018-10-23 08:08 Tao Zhou

    AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application

    For this error, it is caused by the mismatched replyUrls which is defined in the Application Manifest.

    Follow steps below:

    • Check your published App Service URL
    • Login https://apps.dev.microsoft.com/
    • Find the registered applications and Edit Application Manifest
    • Modify the homepage and replyUrls with your app service URL.
    • For replyUrls, it should be something like [app service url]/signin-oidc