试图从@Azure/MSAL库升级到最新的v2 of MSAL.js 2.0,但得到了以下错误:
Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'
注意到,acquireTokenSilent()方法不再接受logon_hint作为参数,而是切换到ssoSilent()方法,而是传递带有logon_hint集的SsoSilentRequest。但还是会犯这个错误..。
发布于 2022-06-20 11:04:38
结果发现,错误信息是很明显的。需要更新验证下的重定向URI,以便在Azure AD中注册应用程序。有一个将URI从Web迁移到单页应用程序的方法.
看起来,要升级到MSAL库的v2.0版本,就需要对App注册进行更改。请参阅Azure门户中的下列警告:
This app has implicit grant settings enabled. If you are using any of these URIs in a SPA with MSAL.js 2.0, you should migrate URIs.
https://stackoverflow.com/questions/72686105
复制相似问题