51003: Client Connection: identity too long
ERROR
The identity value in your Access Token exceeds the maximum length allowed for a Twilio client connection. Twilio rejects the connection request when the token contains an identity that is too long.
- Your application generates an Access Token with an
identitystring that exceeds the product limit. - Your application passes unbounded user input, such as an email address, UUID collection, or concatenated account data, into the
identityfield. - Your token generation logic appends environment, tenant, or session metadata to
identity, causing it to exceed the allowed length.
- Shorten the
identityvalue you include in the Access Token. - Use a stable, compact identifier for each user instead of a long descriptive string.
- Update your token generation logic to validate the length of
identitybefore creating the Access Token. - If you need to associate additional user metadata with the client, store that data in your application instead of embedding it in
identity. - Review the Access Token documentation for your Twilio SDK product and confirm that your generated token matches the required client identity format.