sfreiberg / gotwilio

Twilio library for Go (golang).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid Access Token using Gotwilio withAPIKey, Error 20103

mding5692 opened this issue · comments

Used Gotwilio to generate an access token for Twilio Video API, kept receiving errors for invalid Access Token by Twilio which led to this page: https://www.twilio.com/docs/api/errors/20103

After investigating the jwt token generated by Gotwilio and that of a valid token generated by twilio quickstart.js repo, basically a friend figured out that needed withAPIKey method to work and that the timestamps for token expiry are negative which is also causing a problem so need to fix that too and now my access token is valid.

commented

Thank you for this!

I thought I was getting crazy because the quickstart.js for me also works as expected.

I lost too much time and just switched to https://github.com/kevinburke/twilio-go/token which generates valid tokens 'out of the box'.

I was using KevinBurkes code for this for video and kept getting rejects and couldn't workout why. Had used the same code 2 years ago with no problems on another project. Flipped to this one (5 minutes work) and it worked straight away. Prefer this as uses the public JWT code base and I'm already using that in other code I have, so similar way to work with it.

Closed as believe this has solved the issue