Auth0 Expiration Time Claim Error Occurs In The ID Token
Last Updated:
Overview
The following error occurs when the time difference between a device and the Auth0 JSON Web Token (JWT) exceeds the configured leeway:
Expiration Time (exp) claim error in the ID token
Resolve this issue by correcting the device time or increasing the leeway value in the applicable software development kit (SDK).
Applies To
- Auth0
- Auth0 Single Page Application (SPA) SDK
- Auth0 Android SDK
- JSON Web Token (JWT)
Cause
A discrepancy exists between the timestamp in the Auth0 JWT and the system time configured on the device. The time difference exceeds the configured leeway window, causing Auth0 to reject the token.
Solution
How is the expiration time claim error resolved?
Correct the device clock or adjust the leeway configuration in the applicable SDK.
- Update the device time to match the correct current time.
- Increase the leeway attribute in the SDK configuration if adjusting the device time is not feasible.
How is the leeway adjusted in the Auth0 SPA SDK?
Modify the leeway attribute within the client options.
- Configure the leeway attribute in the
Auth0ClientOptions. - Review the Auth0ClientOptions and Auth0Client documentation for implementation details.
How is the leeway adjusted in the Auth0 Android SDK?
Add additional seconds to the token expiration validation window.
- Use the
withIdTokenVerificationLeeway()method in the WebAuthProvider. - Review the AuthenticationRequest.kt source code for implementation details.