question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: JWT must have 3 parts

See original GitHub issue

Any ideas how to use token without 3-part key, splitted by dots?

Now i get error: JWT must have 3 parts How can i use such tokens (for example): 833ec1ca1a47b128634a4744343a6215

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
CaptainDroidcommented, May 29, 2017

The problem arises due to an improper storage of the token in the localStorage. While saving the token in the localStorage as localStorage.setItem('id_token', token); , now the latest change in angular has modified that to accept a default value of “token” instead of “id_token”, so just change “id_token” to “token” everywhere in the setItem and getItem commands (eg. localStorage.setItem('token', token); ), and that should most probably solve your problem.

3reactions
DavidDecraenecommented, Apr 26, 2017

Actually they are saying I should NOT be using the JWT id_token but rather need to use the opaque non JWT access_token for all requests

For example, when retrieving the user profile you pass the access_token as a bearer

E;g; Authorization: Bearer 833ec1ca1a47b128634a4744343a6215

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does 'JWT must have 3 parts' mean? - Auth0 Community
It sounds like you may be getting an opaque access token instead of a JWT access token. To get a JWT access token...
Read more >
Error on validating JWT token IDX12741. JWT - Stack Overflow
JWT is consist of three parts:header,playload and signature, and they are splited by"." in your jwt string.Your error was caused by the ...
Read more >
JWT: The Complete Guide to JSON Web Tokens
A JWT is made of 3 parts: the Header, the Payload and the Signature. Let's go through each one, starting with the Payload....
Read more >
https://unpkg.com/angular2-jwt@0.1.8/angular2-jwt.ts
3 ) { throw new Error('JWT must have 3 parts'); } var decoded = this.urlBase64Decode(parts[1]); if (!decoded) { throw new Error('Cannot decode the...
Read more >
The token was expected to have 3 parts, but got 1.
Your token must be in the format of JWT, you may be using an incorrect token format here. I think it would be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found