react-aad
react-aad copied to clipboard
getAccessToken throws "TypeError: Cannot read property 'tokenType' of undefined" when third party cookies are blocked
Library versions
-
react-aad-msal
: 2.3.5 -
msal
: 1.3.2
Describe the bug When third party cookies are blocked, I receive an error when using getAccessToken:
"TypeError: Cannot read property 'tokenType' of undefined
at new AccessTokenResponse (AccessTokenResponse.js:42)
at _callee2$ (MsalAuthProvider.js:373)
at tryCatch (runtime.js:45)
at Generator.invoke [as _invoke] (runtime.js:265)
at Generator.prototype.
Expected behavior I would expect that acquireTokenSilent would run, return an error and then acquireTokenPopup or acquireTokenRedirect would run.
To Reproduce Steps to reproduce the behavior:
- Block third party cookies on chrome
- call 'getAccessToken'
- See error
Desktop (please complete the following information):
- OS: Windows
- Browser: Chrome
- Version 83.0.4103.106
I see this error too when third party cookies are blocked. I noticed an issue has already been filed for the underlying MSAL library:
https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1880
I hit this using Google Incognito
Happens when the third party cookies are blocked
Should be resolved by #238