-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Description:
The PersistedAccessTokenCache.GetValidToken method currently checks the JWT token for expiration. However, there is a zero-tolerance window between this check, which causes issues in scenarios where the token becomes invalid for a short duration before the calculated expiration time.
To Reproduce:
- Obtain a JWT token.
- Wait for the token to approach its expiration time.
- Attempt to use the token within the short duration before its calculated expiration time, approximately 300ms.
- Observe that the token is not valid.
Expected behavior:
The PersistedAccessTokenCache.GetValidToken method should consider a token invalid if it is used within a reasonable tolerance window before its calculated expiration time, allowing for minor delays in token retrieval and usage.
Additional context:
This issue affects applications where the token provider's response time causes a slight delay in token retrieval, leading to a brief period where the token is incorrectly deemed valid.