20105: Access Token not yet valid
API, VIDEO
ERROR
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.
- 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.
- 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
nbfin the future unless required; if used, setnbfto the current epoch time so the token is immediately valid, and ensureiatreflects 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
connectto a Room to avoid the corresponding SDK error.