私はMSグラフから一部のデータを取得しようとすると、私は次のエラーを取得する:Microsoftグラフエラー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."
アプリケーションはOffice 365のから一部のユーザーやグループの情報をお読みくださいSharePointのアドインです。
私は、データを取得するために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.を使用login()の後、私はid_tokenを取得します。要求が行われると、トークンが関数に渡されます。
誰もが同じ問題を抱えていますか? ありがとうございます!
:詳細要求について、あなたは以下のリンクを参照することができます。上記のコードは正しいです。あなたのコメントのためにFei Xueに感謝します。 –