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

51103: Twilsock: Token doesn't contain required grants section


ERROR: 51103

error-51103 page anchor
ERROR

You see this error when the Access Token used to authenticate the client does not include a grants object in the JWT payload. Twilio Access Tokens must include at least one grant, and the grant must match the Twilio product your client is using.

Possible causes

possible-causes page anchor
  • The JWT payload does not include a grants object.
  • Your backend generated an Access Token without adding any product grant before calling toJwt().
  • Your Conversations token was created without a ChatGrant. Conversations tokens require a ChatGrant, and that grant must include your Conversation Service SID.
  • Your Sync token was created without a SyncGrant. Sync tokens require a SyncGrant with a serviceSid for your Sync Service.
  • Regenerate the token on your server and confirm the JWT payload includes a valid grants object before you return it to the client.
  • Use a Twilio helper library to create the Access Token instead of assembling the JWT by hand.
  • If you are using Conversations, add a ChatGrant to the token and include the correct Conversation Service SID and identity.
  • If you are using Sync, add a SyncGrant to the token and include the correct Sync Service SID and identity.
  • Decode the token and inspect its structure before initializing the client. If you need to verify the JWT format, use a JWT debugger such as jwt.io.

Additional resources

additional-resources page anchor