0

I am generating the token using PHP SDK. The token signature is verified in jwt.io. All the keys are correct.

While creating the chat client, it throws error.

ems.us1.twilio.com/v1/token a status of 401 (Unauthorized)
EMS E: Error: The authorization with Token failed media.twiliocdn.com/sdk/js/chat/releases/2.2.0/twilio-chat.min.js:241

Attached screenshot shows the token data from jwt.io.

enter image description here

arun kumar
  • 703
  • 2
  • 13
  • 33
  • Is the `exp` time still within the current time when you try to authorize? Does the Account Sid that you are using have access to the Chat Service? – philnash Apr 16 '18 at 02:24
  • Yes to both questions. Meanwhile, I created a twilio function to generate token. The chat client works perfectly with the token received from twilio function. – arun kumar Apr 16 '18 at 08:03
  • Oh, that's odd. Wonder what's going on with the PHP helper then. Would you be able to raise an issue on the [GitHub repo](https://github.com/twilio/twilio-php/) so that it can be investigated? – philnash Apr 16 '18 at 08:05
  • I raised a support ticket to twilio with the php code and keys. I assume they are investigating it. I have also noticed in another thread that Video client fails with the token generated from PHP server. Not sure it is related. – arun kumar Apr 16 '18 at 08:19
  • That might well be related, thanks for raising that. :) – philnash Apr 16 '18 at 09:04

0 Answers0