0

Trying to upgrade from the @Azure/MSAL library to the latest v2 of MSAL.js 2.0 but getting the following error:

Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'

Noticed that the acquireTokenSilent() method no longer takes a logon_hint as a parameter so switched to the ssoSilent() method instead and pass in a SsoSilentRequest with the logon_hint set. Still getting this error though...

sevenam
  • 592
  • 1
  • 8
  • 21

1 Answers1

0

Turned out the error message was sort of obvious. Need to update the redirect URIs under Authentication for the App registration in Azure AD. There is a to migrate the URIs there from Web to Single-Page Application...

Looks like this change to the App registration is required for upgrading to the v2.0 version of the MSAL library. Ref the following warning in the Azure Portal:

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.

sevenam
  • 592
  • 1
  • 8
  • 21