【发布时间】:2018-05-18 18:40:02
【问题描述】:
我需要做的是从 C# Web API 调用 Microsoft graph。这基本上就是我的方法的样子:
var clientCredential = new ClientCredential(clientId, clientSecret);
AuthenticationContext context = new AuthenticationContext(authority);
AuthenticationResult authenticationResult = context.AcquireToken(clientId, clientCredential);
if (authenticationResult == null)
{
throw new InvalidOperationException("Failed to obtain the token");
}
return authenticationResult;
我通过这个电话收到的是:
然后我的想法是调用 microsoft graph 传递这个令牌(我什至不能 100% 确定这是实现隐式流的正确方法)......但之后我收到“无效令牌”错误.
谁能告诉我我在哪里做错了? 非常感谢!
【问题讨论】:
标签: c# azure oauth-2.0 sharepoint-online