I have a .NET Core 2 app template that is configured to use Azure AD out of the box.
The configuration is:
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "lautaroarinolive.onmicrosoft.com",
"TenantId": "67cb2dfd-ebd5-40d8-829b-378340981a17",
"ClientId": "50819a7a-e018-4c1d-bf0a-18c8fce5c600",
"CallbackPath": "/signin-oidc"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
In my portal, I have an Azure app registration with the same id as ClientId
. It has the reply URL [APP-URL]/signin-oidc
.
The localhost app works only if I set the reply URL to [LocalhostURL]/signin-oidc
, even though I've learned that the configuration should not affect log in on localhost.
The Azure app does not work in any case.
In both apps when it doesn't work I get this error:
AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: '50819a7a-e018-4c1d-bf0a-18c8fce5c600'
Is it correct that a localhost app should not need a configured reply URL?
Why do I get the "reply url not configured" error?
You can refer to this Sample to rebuild your .NET core App and publish to the Azure.
There are some NOTES you neeed to pay attention to :
you need to change the port from 5000 to the effective one. Currently, it should be 61659.So, when you do a test in your local host, you can set the reply url in the AAD App with http://localhost:61659/signin-oidc
Update these URLs if you configure the app for production use or If you publish the App to Azure Web App, you should change the Reply url in both App config file and AAD Applicaiton to be <AppURL>/signin-oidc
For example, https://www.contoso.com/signin-oidc
or https://Myapp.azurewebsites.net/signout-oidc
.
Ok so its not possible to have it configured for localhost and Azure Web App at the same time?
Now it works. Both localhost and in azure. I added both reply URL:s. In your example, i added both localhost:61659/signin-oidc and Myapp.azurewebsites.net/signout-oidc and now i can login both online in azure app and in localhost.
Yep, you cannot add different domain in the reply URLs, but you can add the localhost .When you publish your App to azure, you needn't to configure the localhost in Azure.If you also want to lgoin with localhost, you can just add localhost in the reply urls
Hi @whihathac , you can see the restriction here:docs.microsoft.com/en-us/azure/active-directory/develop/…