我使用MSAL for angular从AzureAd生成jwt。我需要检索这个令牌,并将其发送到signalr连接请求以进行身份验证。我在MSAL服务中看不到用于取回令牌的API。有什么想法吗?
发布于 2020-06-09 10:15:10
您可以通过自定义msalinterceptor获取令牌,也可以根据此处的文档直接调用acquiretoken:https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular#3-get-tokens-for-web-api-calls
您可以订阅回调,并对返回的token做一些事情。
或者,如果您想要直接调用get令牌:https://azuread.github.io/microsoft-authentication-library-for-js/ref/msal-angular/可以运行像acquiretokensilent()这样的命令,
https://stackoverflow.com/questions/62271590
复制相似问题