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

@tushargupta51 I am trying to renew the token with a custom expiration offset value from config. #867

Closed abhaygitty closed 3 years ago

abhaygitty commented 5 years ago

@tushargupta51 I am trying to renew the token with a custom expiration offset value from config. But I don't think, that the acquireToken() method works as expected. I meant, the expiration time of the token doesn't get updated after being reset to 0 in the getCachedToken() ` /**

Further the renewIdToken() function is called due to the null token returned from the getCachedToken() function. image

Here in the above function, the RENEW_STATUS doesn't change to complete. Therefore, I tried invoking the handleWindowCallBack() funtion (within which there's a call to the saveTokenFromHash() function which writes the token and the expiration Epochs to the sessionStorage and also does switch the status from "In progress" to "Completed" as seen below) which again fails to run as the window.location.hash is empty.

image

In addition to the above problem, I would also like to know, "when does the window.location.hash field get its value written?"

Please do guide me on what's wrong with what I am doing. Thanks in advance.

Originally posted by @abhaygitty in https://github.com/AzureAD/azure-activedirectory-library-for-js/issues/290#issuecomment-490687297

jmckennon commented 4 years ago

cc @sameerag @jasonnutter - can we provide some guidance here?

pramodpadmanabhi commented 4 years ago

@tushargupta51 Facing the same issue as above mentioned, AcquireToken() always returns cached Token even after expireOffSetSeconds is reset

@abhaygitty Have U found any workaround?

jasonnutter commented 3 years ago

Closing, as assuming this has been resolved. ADAL.js is no longer actively maintained, so we highly recommend moving to MSAL.js.

If you have further questions, please open a new issue in the MSAL.js repo: https://github.com/AzureAD/microsoft-authentication-library-for-js/issues