1

我正在尝试调试一些 JS 代码以静默获取令牌。

但是我需要进入这个处理acquireTokenFailure事件的特定函数:

$rootScope.$on("msal:acquireTokenFailure", function (event, errorDesc, error)
{
    console.log("acquireTokenFailure:\n" + error + " - " + errorDesc);

    //msalService.acquireTokenSilent(['openid offline_access']);

    if (error.indexOf("consent_required") !== -1 || error.indexOf("interaction_required") !== -1)
    {
        msalService.acquireTokenSilent(['openid']).then(function (token)
        {
            debugger;

            // retry the API call...

        }, function (error)
           {
               debugger;

               console.log(error);
        });
    }
});

是否有任何直接的方法可以手动使令牌过期,以便我可以进入上面的 JS 函数?

顺便说一句:我正在使用这个特定于 Angular JS 的示例项目MsalAngularjsDemoApp 。

我看到有人问过@MSAL GitHub repo 这样的问题,但到目前为止还没有令人满意的答案......

4

0 回答 0