Closed Wozbo closed 4 years ago
I have also been seeing similar behavior.
Should we not instead return the token and have a separate check that determines if the token should be renewed?
I agree but I'm not sure what that separate check would look like and when would it be called?
This is still an issue and is now affecting tokens issued in India; there seems to be a time skew on the return from AD that is causing tokens to expire earlier than expected. This seems to be about 30 - 45 seconds or so.
This seems to be related/ exacerbated by: https://github.com/Azure/azure-documentdb-dotnet/issues/512
In adal.js, the getCachedToken function (provided) has a side effect that affects people using this.
If the token's expiry is within the zone of the expire offset, the token gets nulled out in the session and nothing is returned. The issue here is that depending on this for JWT bearer requests will fail intermittently while the application is refreshing the token.
Why are we unsetting and returning null if the token is within the expiry zone? Should we not instead return the token and have a separate check that determines if the token should be renewed?