# 20105: Access Token not yet valid

Log Type: TWILIO

Log Level: ERROR

## Description

This error indicates that the Access Token presented to Twilio is not valid yet. Twilio Access Tokens are JSON Web Tokens that can include an optional `nbf` claim which defines the earliest time the token is accepted; if `nbf` is in the future relative to the validating system, the request will fail with this error.

### Possible causes

* The token's `nbf` (not-before) claim is set to a future timestamp, so the token is not yet accepted for use.
* Clock drift or incorrect system time on the machine generating or validating the token causes the current time to fall before the token's validity start.
* In Programmable Video apps, attempting to connect with a token before it becomes valid triggers an SDK error corresponding to this code.

### Possible solutions

* Ensure the system time on token-issuing and validating hosts is correct; resolve any clock drift so the current time is on or after the token's intended start.
* When creating Access Tokens, avoid setting `nbf` in the future unless required; if used, set `nbf` to the current epoch time so the token is immediately valid, and ensure `iat` reflects the actual issuance time.
* Reissue the token closer to the time of use (with an appropriate `ttl`) so it becomes valid when needed; Access Tokens are short-lived (maximum 24 hours).
* For Video SDK apps, wait until the token becomes valid or obtain a fresh token before calling `connect` to a Room to avoid the corresponding SDK error.

#### Additional resources

* [Access Tokens](/docs/iam/access-tokens)
* [User Identity & Access Tokens for Programmable Video](/docs/video/tutorials/user-identity-access-tokens)
* [Debugging Your Twilio Application](/docs/usage/troubleshooting/debugging-your-application)
