【发布时间】:2018-07-31 16:54:33
【问题描述】:
我使用的是 adal.js 1.0.14,下面是我的登录信息
var authenticationContext = new AuthenticationContext(config);
if (!config.popUp) {
if (authenticationContext.isCallback(window.location.hash)) {
authenticationContext.handleWindowCallback();
}
}
var user = authenticationContext.getCachedUser();
sessionStorage.setItem("adal:Tenant","@CommonMethods.GetAppConfigValue("ida:TenantId")")
if (!user) {
authenticationContext.login();
}
以下是我的续订代码
this.authenticationContext.getCachedUser();
this.authenticationContext.acquireToken(config.clientId, function (errorDesc, token) {
if (errorDesc) {
console.log("ErrorDesc", errorDesc);
}
if (token) {
console.log("calling the Web API with the access token", token);
}
});
但我得到“需要用户登录”。无法理解这是怎么回事。
【问题讨论】:
标签: angularjs azure-active-directory adal