【问题标题】:AADSTS70002: Error validating credentials in my Azure AD AppAADSTS70002:在我的 Azure AD 应用程序中验证凭据时出错
【发布时间】:2017-01-01 11:40:14
【问题描述】:

在我的 Azure AD 应用程序中,我试图在下面的部分中检索访问令牌

 AuthorizationCodeReceived = (context) =>
                        {
                            var code = context.Code;
                            ClientCredential credential = new ClientCredential(ClientId, appKey);
                            string signedInUserID = context.AuthenticationTicket.Identity.FindFirst(ClaimTypes.NameIdentifier).Value;
                            AuthenticationContext authContext = new AuthenticationContext(Authority, new ADALTokenCache(signedInUserID));
                            AuthenticationResult result = authContext.AcquireTokenByAuthorizationCode(
                            code, new Uri(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path)), credential, graphResourceID);

                            return Task.FromResult(0);
                        },

我得到以下错误

{"AADSTS70002:验证凭据时出错。AADSTS50011:回复 地址“https://localhost:44301/”与回复地址不匹配 请求授权时提供'https://localhost:44301' 代码。\r\n跟踪 ID: fd34bd6b-37d5-4b66-85d0-657b27103049\r\n相关性 ID: ea970ddb-cab8-4949-b749-1b4a8d7b5a6b\r\n时间戳: 2016-08-25 06:44:59Z"}

在 Azure 门户中,我仔细检查了回复 URL 是否应该匹配 这里应该有什么问题?

【问题讨论】:

    标签: access-token azure-active-directory


    【解决方案1】:

    您的重定向 URI 必须相同。在您的情况下,一个结尾有斜线,另一个没有。

    【讨论】:

      猜你喜欢
      • 2019-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-28
      • 2016-06-08
      相关资源
      最近更新 更多