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.

The inspected token doesn't appear to be a JWT

See original GitHub issue

Hi

Using angular-jwt with Angular 5 I’m getting Error: The inspected token doesn’t appear to be a JWT when trying checking the token expiration with isTokenExpired('refresh_token')

The token is valid according to jwt.io capture d ecran 2018-02-21 a 10 41 19

I got the same error in my interceptor while doing this.jwtHelper.isTokenExpired('access_token')

By simply having this.jwtHelper.isTokenExpired() in my interceptor it works (though I’m not sure of the behavior …) but in the case of the refresh I absolutely need to check the refresh token (otherwise it’d be non-sense).

I can’t seem to find a solution to this 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
mlcdfcommented, Apr 12, 2018

@maikdiepenbroek I had the same issue as OP, and that was the cause. Good catch, thank you.

2reactions
maikdiepenbroekcommented, Feb 24, 2018

Not sure if you’re not already doing this but are you getting the token before checking it ?

like

const refreshToken = tokenGetter();
this.jwtHelper.isTokenExpired(refreshToken)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 2 AuthHttp with jwt not connecting - Stack Overflow
I'm trying to use jwt's authHttp to set an API connection to a particular Back End. I'm trying to make it first without...
Read more >
JWT Error @auth0/angular-jwt
The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.
Read more >
Error: The inspected token doesn't appear to be a JWT. Check ...
Error: The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more....
Read more >
JWT: The Complete Guide to JSON Web Tokens
A Step-by-Step Guide for learning JSON Web Tokens, including signatures, single page web application User Authentication and Session ...
Read more >
Troubleshooting JWT validation - Google Cloud
When a client application includes a JSON Web Token (JWT) in a request to an API, ... If the flag is not used,...
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