AADSTS50011:请求中指定的答复URL与为应用程序配置的答复URL不匹配:“< AppId>" [英] AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: '<AppId>'

查看:2111
本文介绍了AADSTS50011:请求中指定的答复URL与为应用程序配置的答复URL不匹配:“< AppId>"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.NET Core 2应用程序模板,该模板配置为开箱即用使用Azure AD.

I have a .NET Core 2 app template that is configured to use Azure AD out of the box.

配置为:

{
  "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"
    }
  }
}

在我的门户中,我有一个Azure应用程序注册,其ID与ClientId相同.它具有回复URL [APP-URL]/signin-oidc.

In my portal, I have an Azure app registration with the same id as ClientId. It has the reply URL [APP-URL]/signin-oidc.

如果我将回复URL设置为[LocalhostURL]/signin-oidc,则localhost应用程序仅可运行 ,即使我了解到该配置也不会影响在localhost上的登录.

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.

Azure应用程序在任何情况下均不起作用.

The Azure app does not work in any case.

在两个应用程序中都无法正常工作时,出现此错误:

In both apps when it doesn't work I get this error:

AADSTS50011:请求中指定的回复网址与 回复为应用程序配置的URL: '50819a7a-e018-4c1d-bf0a-18c8fce5c600'

AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: '50819a7a-e018-4c1d-bf0a-18c8fce5c600'

  1. localhost应用程序不需要配置的回复URL是否正确?

  1. Is it correct that a localhost app should not need a configured reply URL?

为什么会出现未配置答复网址"错误?

Why do I get the "reply url not configured" error?

推荐答案

您可以参考 此示例 以重建您的.NET核心应用并发布到Azure.

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 :

  1. 您需要将端口从5000更改为有效端口.当前应该是61659.因此,当您在本地主机中进行测试时,可以使用http://localhost:61659/signin-oidc

如果将应用程序配置为用于生产用途或将其发布到Azure Web App,请更新这些URL,应同时将应用程序配置文件和AAD应用程序中的答复URL"都更改为<AppURL>/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

例如https://www.contoso.com/signin-oidchttps://Myapp.azurewebsites.net/signout-oidc.

这篇关于AADSTS50011:请求中指定的答复URL与为应用程序配置的答复URL不匹配:“&lt; AppId&gt;"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆