Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

51118: Twilsock: Invalid claim set


ERROR: 51118

error-51118 page anchor
ERROR

This error occurs when Twilio cannot validate the claim set in the Access Token used to authenticate a Twilsock connection. Twilio Access Tokens are JWTs for client-side SDKs, and the payload must include valid claim values such as jti, iss, sub, iat, optional nbf, exp, and grants.

Possible causes

possible-causes page anchor
  • The token payload is malformed or missing required claims such as iss, sub, exp, or grants.
  • The token was generated with credentials that do not belong together, such as a mismatched Account SID, API Key SID, and API key secret, or it was created with test credentials instead of live credentials.
  • The token does not include the product grant required by your SDK, or the grant is missing required values for that product.
  • The client sent something other than the serialized JWT string, such as a JSON object or another wrapped token format.
  • Generate the token with a Twilio helper library or SDK instead of constructing the JWT manually.
  • Decode the token in a JWT debugger and compare the payload to Twilio's expected Access Token structure before returning it to the client.
  • Verify that iss contains the API Key SID, sub contains the live Account SID, the timestamps are valid, and grants includes the permissions required by your SDK.
  • Confirm that the API Key SID and API key secret match and that all credentials come from the same live account or subaccount.
  • If you use Conversations, include a ChatGrant with a valid service_sid and an identity grant.

Additional resources

additional-resources page anchor