小编Pau*_*aul的帖子

访问令牌的“无效签名”错误(Azure Active Directory / msal js)

我使用 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)

azure-active-directory msal.js

5
推荐指数
2
解决办法
4162
查看次数

标签 统计

azure-active-directory ×1

msal.js ×1