You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
The Token lifetime duration is different depending on the issuer (identity service) settings (can be seconds, hours or days). Instead of using constant value, consider using configuration setting or calculate as percentage of the token lifetime length.
Pros and cons:
Using configuration settings for the expiration "window" will make it more visible for the developer. Default value can be used if not set in the settings (for backwards compatibility - zero?).
The percentage calculation is more flexible, but can introduce additional complexity and unknown behaviour for developers using the library.
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:
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.
The text was updated successfully, but these errors were encountered: