[英]Get access_token if you have id_token MSAL
I'm using MSAL lib for authorize my SPA. 我正在使用MSAL lib授权我的SPA。 Init:
在里面:
msUserAgent = new Msal.UserAgentApplication(idApp, null, null, {});
Call loginPopup: 呼叫loginPopup:
msUserAgent.loginPopup(['user.read'])
.then((res) => console.log(res))
.catch((err) => console.log(err));
after set my credentials, popUp not closing, but redirect to main page. 设置好凭据后,popUp不会关闭,但会重定向到主页。 Then and catch not called at all.
然后,抓住根本没有被召唤。 Issue on github about this: https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/174
关于此的github问题: https : //github.com/AzureAD/microsoft-authentication-library-for-js/issues/174
After redirect, my URL (in popup) has id_token (jwt-token), but this page doesn't have initialized msUserAgent
yet. 重定向后,我的URL(在弹出窗口中)具有id_token(jwt-token),但是此页面尚未初始化
msUserAgent
。 It dynamically process, I initialize msUserAgent
after user click (idApp getting from backend) 它动态处理,我在用户单击后初始化
msUserAgent
(从后端获取idApp)
Question: Can I get access_token when I have id_token (jwt-token) by using MSAL lib? 问题: 使用MSAL lib获得id_token(jwt-token)后,我能否获得access_token?
Thanks 谢谢
for getting access_token need to do next: 获取access_token下一步需要执行以下操作:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.