Microsoft ADD - App registration - The reply url specified in the request does not match the reply urls configured

♀尐吖头ヾ 提交于 2021-01-28 01:52:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!