AzureAD / azure-activedirectory-library-for-js

The code for ADAL.js and ADAL Angular has been moved to the MSAL.js repo. Please open any issues or PRs at the link below.
https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/maintenance/adal-angular
Apache License 2.0
627 stars 374 forks source link

After renew token app does not receive new token #783

Closed MartineFrancken closed 5 years ago

MartineFrancken commented 6 years ago

I'm investigating an issue in our app where users are redirected to the home page after using the application for over an hour. I already learned that this is because of the redirectUri requires authentication. I therefore changed the redirectUri to a page that does not require any authentication.

After this change, the user is not redirected to the home page on token renewal, but the application can't perform any requests anymore. It appears that the app never receives the response from the iFrame with the new token.

During debugging I noticed that _renewStates is used to check if there is a stateMatch. The stateMatch is false, since the iFrame is handling the callback and does not have knowledge of the _renewStates set in the app itself. The callback from the request requiring a new token is also never called since the iFrame has no knowledge of the _callBackMappedToRenewStates set in the application.

How can I make sure the callbacks from the application are called after receiving the new token?

Teckden commented 6 years ago

@MartineNavara here is a similar thread, there are few suggestions that helped me to understand the possible workaround to fix similar issue https://github.com/AzureAD/azure-activedirectory-library-for-js/issues/391

MartineFrancken commented 6 years ago

Thank you for your response. For now we are using v1.0.15, which does works as expected.

nehaagrawal commented 5 years ago

closing this issue since it's working.