【发布时间】: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"}
【问题讨论】:
标签: access-token azure-active-directory