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

Access token is not getting refreshed

Open nairmanu opened this issue 5 years ago • 0 comments
trafficstars

Library versions

  • react-aad-msal: 2.3.5
  • msal: 1.3.2

Describe the bug Access token is not getting refreshed when user is already logged in.

The processLogin() refreshes the IdToken when getAccount() is successful but does not perform a refresh of access token before triggering LoginSuccess event. This causes any subsequent API calls that requires the access token to fail without a manual user login process. Is it intentional to not renew the access token?

https://github.com/syncweek-react-aad/react-aad/blob/a7205ef20c6f9dafff94afbe276fa8fba46b9ef0/packages/react-aad-msal/src/MsalAuthProvider.ts#L333

Expected behavior when token is renewed, both id token and access token should be renewed before LoginSuccess event is triggered. If one of them fails, login should be considered a failure.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version 84.0.4147.105

nairmanu avatar Jul 31 '20 17:07 nairmanu