Azure-Samples/active-directory-dotnet-webapp-openidconnect

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

Closed this issue · 10 comments

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

I followed the steps for setting up the wepAPI app registration setting https://localhost:44320/ as one of the reply urls and also as the home page URL

I took the appID and created a key, taking the key value and I have changed no code just updated the appsettings.json values ClientId=appId from service principle, ClientSecret=key value and RedirectUri. RedirectUri is set to https://localhost:44320/ (all as instructed). I checked the application settings in visual studio under debug, enable SSL is ticked with the same https://localhost:44320/ and the enabled anonymous authentication is also ticked. All of these steps from the readme

When i run the project in debug on IIS express, when i click the singup or signing button i get the expected browser page on https://login.microsoftonline.com/common/login, i enter my credentials and then i get Sorry, but we’re having trouble with signing you in.

AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application:
where is my correct expected alphanumeric client ID code
Any help?

@udderchaos : this is an application registration issue. Are you sure you have put the / at the end of the reply URL in the Azure portal? https://localhost:44320/ ?

Alternatively did you try to run the auto configuration for the sample (See https://github.com/Azure-Samples/active-directory-dotnet-webapp-openidconnect/blob/master/AppCreationScripts/AppCreationScripts.md). This creates an app (and modifies your core). this way you can compare the app you have registrered and the app that got created for differences.

Thanks for getting back so quick, yeah I've put / at the end, still no luck. Haven't run the auto config scripts, was hoping to understand why these steps didn't work rather than run some magic that i cant explain or replicate myself :)

@udderchaos : I understand :)
If you still have the issue then, I'll try to have a look at the step, but can't be before next week ....

@udderchaos : did you solve your problem?

Nope, it's not urgent - I'm using a function with MSI at this point for my use case. But might be useful for investigating for other users?

I have this problem too.

@ntimmerman can you please tell me:

  • what is the reply URI registered in the portal?
  • At which reply URI Visual Studio launches your web app (assuming you have the issue when you debug)

cc: @kalyankrishna1

Hi @jmprieur, I think what I was potentially encountering some kind of Azure Portal problem where the value I was saving in Reply URLs was not actually saving properly. I noticed there was two sections in the Azure AD blade: App Registrations and App Registrations (Preview). I tried the Preview out and immediately it began working with zero changes to code configuration on the client side.

thanks for confirming, @ntimmerman
Closing this issue./

Thinking back a bit upon this now, I also think I was potentially not being patient enough to wait for Azure to complete the save. So, I would rapidly click the "save" button, flip back to Visual Studio and retry immediately, and then when it failed, assumed I had entered the wrong thing and tried a different value. The problem with that is, Azure Portal is very asynchronous -- we have to wait for actions to complete.