react-aad icon indicating copy to clipboard operation
react-aad copied to clipboard

getAccessToken throws "TypeError: Cannot read property 'tokenType' of undefined" when third party cookies are blocked

Open orlahowell opened this issue 4 years ago • 4 comments

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. [as next] (runtime.js:98) at asyncGeneratorStep (MsalAuthProvider.js:72) at _next (MsalAuthProvider.js:94)"

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:

  1. Block third party cookies on chrome
  2. call 'getAccessToken'
  3. See error

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version 83.0.4103.106

orlahowell avatar Jun 26 '20 08:06 orlahowell

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

ashtmMSFT avatar Jul 13 '20 22:07 ashtmMSFT

I hit this using Google Incognito

ejdoh1 avatar Jul 21 '20 01:07 ejdoh1

Happens when the third party cookies are blocked

SubhasisDebsharma avatar Sep 02 '20 14:09 SubhasisDebsharma

Should be resolved by #238

GraemeF avatar Sep 15 '20 07:09 GraemeF