【发布时间】:2018-06-05 22:50:52
【问题描述】:
我已经阅读了一些堆栈问题。
我有一个简单的 Web 应用程序,身份验证运行良好。我只是使用 ADAL 及其工作。
var endpoints = {
"https://graph.microsoft.com": "https://graph.microsoft.com",
'https://login.microsoftonline.com/':'https://login.microsoftonline.com/'
}
window.config = {
tenant: 'xxx.com',
clientId: guid,
endpoints: endpoints,
cacheLocation: 'localStorage',
};
我登录
authContext.login();
我得到一个令牌
authContext.acquireToken(config.clientId,
function (error, token) {
if (error) console.log(error);
localStorage.setItem('token', token);
}
);
一切正常,我想我需要https://graph.microsoft.com 的另一个令牌,所以我这样做了
authContext.acquireToken('https://graph.microsoft.com',
function (error, token) {
console.log('callback token graph', token, error);
if (error) console.log(error);
localStorage.setItem('gtoken', token);
}
这永远不会打回电话。我已经尝试删除对acquireToken 的第一次调用
或者是我的第一个令牌用于 Microsoft Graph 调用(这是我认为一开始应该如何工作,我有点绕圈子:))
【问题讨论】:
标签: javascript microsoft-graph-api adal