Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

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.

None yet

2 participants