问题
I created a web application which is working with an Azure Active Directory authentification.
Everything works fine on localhost, but I'm getting the following error when I publish the application into Azure:
AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: '656cc46c-f858-4a45-bf83-698791e052f1'.
What I tried:
In Azure, I configured the Reply URL of the application in question to be:
http://gp-rh.azurewebsites.net/signin-oidc
Here is my appsetting.json:
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "legroupeti.com",
"TenantId": "7c6ff5e2-0660-4b65-9b64-7a78df412819",
"ClientId": "656cc46c-f858-4a45-bf83-698791e052f1",
"CallbackPath": "/signin-oidc"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
In my application, the controller that does the login is set like this:
[HttpGet]
public IActionResult SignIn() {
var redirectUrl = Url.Action("Index", "Dashboard",
new { date = DateTime.Now, anchor = "period" });
return Challenge(
new AuthenticationProperties { RedirectUri = redirectUrl },
OpenIdConnectDefaults.AuthenticationScheme);
}
The default page for my application is /
which redirect to /Dashboard
.
I don't know where I went wrong, but it still does not work.
回答1:
The redirect_uri
must match one of your registered URIs exactly, including the scheme (http://
, https://
).
In general, you should only use an unsecured scheme (http
) for development purposes. For test/stage/production, you should always use a secure connection (https
). In this case, there is absolutely no reason to not use https://gp-rh.azurewebsites.net/signin-oidc
since azurewebsites.net
supports HTTPS by default.
来源:https://stackoverflow.com/questions/50957573/microsoft-add-app-registration-the-reply-url-specified-in-the-request-does-n