51118: Twilsock: Invalid claim set
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.
- The token payload is malformed or missing required claims such as
iss,sub,exp, orgrants. - 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
isscontains the API Key SID,subcontains the liveAccount SID, the timestamps are valid, andgrantsincludes 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
ChatGrantwith a validservice_sidand anidentitygrant.