twilio / twilio-video-app-react

A collaboration application built with the twilio-video.js SDK and React.js
Apache License 2.0
1.8k stars 725 forks source link

Invalid Access Token issuer/subject Error Code: 20103 #749

Open deepakdumraliya opened 1 year ago

deepakdumraliya commented 1 year ago

Discussed in https://github.com/twilio/twilio-video-app-react/discussions/748

Originally posted by **deepakdumraliya** September 8, 2022 Hello, I am getting the following error Invalid Access Token issuer/subject Error Code: 20103 I have created a custom API to get an access token and called the same can you check the same and let me know what the issue is? https://video-app-7103-7184-dev.twil.io?passcode=80573471037184
timmydoza commented 1 year ago

Hey @deepakdumraliya - thanks for the issue!

Thanks so much for sharing the link to your app. I could easily tell what is going on.

The "Invalid Access Token issuer/subject" error means that the Video SDK does not recognize the Twilio Account SID (subject) or API Key SID (issuer) of the token that the custom API is returning. This doesn't mean that the token is bad though.

I see that REACT_APP_TWILIO_ENVIRONMENT: "dev" is set in you .env file, which will direct our SDK to connect to our 'dev' servers instead of our 'prod' servers. The Account SID that issued the token does not exist in our 'dev' servers. Our 'dev' servers are just for internal use, so your app should always be connecting to the 'prod' servers. To do this, just remove REACT_APP_TWILIO_ENVIRONMENT: "dev" from your .env file and the SDK will default to the 'prod' servers.

Please let me know how this works out for you!