我有一个Web应用程序,我正在尝试使用下面提到的代码片段同时获取Power BI和Microsoft Graph API的令牌。
AuthenticationContext authContext =
new AuthenticationContext(Authority, new NaiveSessionCache(signedInUserID));
//Getting Power BI token
AuthenticationResult result = await authContext.AcquireTokenByAuthorizationCodeAsync(
code,
new Uri(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path)),
credential,
pbiResourceID);
//Getting Graph token
AuthenticationResult graphResult = await authContext.AcquireTokenByAuthorizationCodeAsync(
code,
new Uri(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path)),
credential,
graphResourceId);
从Graph API获取令牌的请求失败,错误:
AADSTS50079:用户需要使用多重身份验证