Today I faced an issue with Azure Active Directory authentication that was interesting enough to not this down for later reference š.
Iāve got this issue in our (new) web application:
With the help from this blogpost from Antti Iāve learned that the url youāve entered to redirect to after the authentication is done, has to match exactly with the URL you send in with the Authentication Request itself.
To verify your own setup, go to the App Registration Setup and find the URL you are using.
I my case, we where using OpenIdConnect middleware that listens on a specific url for the callback that you can specify yourself (so you can match it with the App Registration). To make it clear where we are coming from, Iām using signin-microsoft
.
In the image below you can find the place where we configure this callback path (we load it from the configuration here). Do note that the middleware doesnāt want the root path here, so /signin-microsoft
will do the trick in this case.