51006: Client Connection: Connection expired
ERROR
The client connection expired because the Access Token used to authenticate the client is no longer valid. Twilio ends the connection when the token reaches the expiration time defined by the exp claim.
- The Access Token expired before the client finished connecting or while the client was connected.
- Your application issued a token with an expiration time that is too short for the client session.
- The client did not refresh the Access Token before the current token expired.
- The device clock or your token generation logic caused the
expvalue to be set earlier than intended.
- Generate a new Access Token and reconnect the client.
- Refresh the Access Token before it expires, especially for long-lived client sessions.
- Review your token generation logic and confirm the
expclaim allows enough time for the expected session length. - If your app maintains persistent connections, implement token renewal in the client before expiration.
- Verify that the system time on the client device and the server generating tokens is accurate.