Skip to content

Fix: Made it so that it reads the JWT and sends the appropriate strin…#370

Open
codingwithmanny wants to merge 2 commits intotwilio:masterfrom
codingwithmanny:master
Open

Fix: Made it so that it reads the JWT and sends the appropriate strin…#370
codingwithmanny wants to merge 2 commits intotwilio:masterfrom
codingwithmanny:master

Conversation

@codingwithmanny
Copy link

Context:
Following this tutorial on YouTube: https://www.youtube.com/watch?v=5lrdYBLEk60
This is a proposal for a small fix I noticed when trying to pass the token for establishing a connection.

Error:

20101 Invalid Access Token.

Reason For Error:
The reason is because it's not passing just the JWT but the full payload for the JSON string.

Ex:

"{"token\":\"ey.....\"}"

Fix Includes:
Very primitive fix for just reading the JSON data and assigning the token value to accessToken.

Contributing to Twilio

All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

m added 2 commits April 3, 2019 11:03
Copy link
Contributor

@paynerc paynerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer that this token extraction from the JSON happens inside the TokenUtils.fetchToken() method as that method is used in all of the Quickstart projects. This would also then ensure that the returned value from TokenUtils.fetchToken() is actually that, the JWT token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants