0
当我正在尝试从MS图形的一些数据我收到以下错误:微软图形错误InvalidAuthenticationToken
{error: {code: "InvalidAuthenticationToken", message: "Access token validation failure.",…}}
error:{code: "InvalidAuthenticationToken", message: "Access token validation failure.",…}
code:"InvalidAuthenticationToken"
innerError:{request-id: " xxx ", date: "2016-11-28T10:25:52"}
date : "2016-11-28T10:25:52"
request-id: " xxx "
message : "Access token validation failure."
的应用程序是一个SharePoint外接应阅读Office 365的一些用户和组信息。
我用follwoing代码检索数据:
$.ajax({
type: "GET",
url: "https://graph.microsoft.com/v1.0/me/",
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer' + token
}
}).done(function (response) {
console.log(response);
//alert(response);
}).fail(function() {
console.log('Error occurred.');
});
对于authenication我用adal.js.登录后()我得到了id_token。当请求发出时,令牌被传递给该函数。
有没有人有同样的问题,可以帮忙吗? 在此先感谢!
我使用了错误的终点在'aquireToken'请求。所以上面的代码是正确的。非常感谢费雪的评论。 –