我使用 MSAL JS 来验证用户身份,然后调用 acquireTokenPopup(scopes) 来获取访问令牌。
我正在获取访问令牌,但无法使用它,因为它显示Invalid Signature。(也在 jwt.io 中检查过 - 同样的错误)
在论坛上我发现这是由于 Graph 添加了随机数造成的。解决方案是什么?请帮忙。
以下是代码。
tenantConfig = {
scopes: ["directory.read.all"]
};
Run Code Online (Sandbox Code Playgroud)
this.clientApplication.acquireTokenSilent(this.tenantConfig.scopes).then( 函数 (accessToken) {
},
function (error) {
console.log(error);
this.clientApplication
.acquireTokenPopup(this.tenantConfig.scopes)
.then(
function (accessToken) {
console.log("access token " + accessToken);
},
function (error) {
alert(error);
}
);
}
);
Run Code Online (Sandbox Code Playgroud)