使用 msal检索令牌



我使用 MSAL for angular 从 AzureAD 生成 jwt。 我需要检索此令牌并将其发送到信令连接请求进行身份验证。 我在 MSAL 服务中看不到用于取回令牌的 API。 有什么想法吗??

您可以通过使用自定义 msalinterceptor 来获取令牌,也可以只调用 acquiretoken API 根据此处的文档:https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular#3-get-tokens-for-web-api-calls

您可以订阅回调并使用返回的令牌执行某些操作,

或者,如果要直接调用获取令牌: https://azuread.github.io/microsoft-authentication-library-for-js/ref/msal-angular/可以运行类似 acquiretokensilent((,

最新更新