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.

JWT is not yet valid

See original GitHub issue

Hi there

Im using asp.net core 2.0.3 with “Google.Apis.Auth” 1.33.0. I’m validating the id token of google+ with GoogleJsonWebSignature.ValidateAsync

It does work fine on my local Windows development machine, but it doesn’t work on my debian jessie server.

situation

Time snapshot before i start signin with google+: image Console: Debian Server in Germany Windows Client in Switzerland

Both at Monday, May 14, 2018 00:00, BUT: the servers time is 7 seconds behind my client time

signin process

At 00:00:19, at the debian server, i request the jwt token from google At 00:00:20, at the debian server, I received the jwt token from google, which contains following iat: image At 00:00:20, at the debian server, i received following log entry

xyzserver api[16255]: Google.Apis.Auth.InvalidJwtException: JWT is not yet valid.

conclusion

It looks like the IAT is 2 seconds after my server time, thats why the validation fails. If im using the validation endpoint (which everyone tells you should not), it does works.

What would be the best practice in that case?

  • Should i implement a custom IClock interface, which syncs with google’s time server?
  • Should i use the validation endpoint?
  • Should i try to fix the servers time?

Thanks

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
chrisdunelmcommented, May 31, 2018

This has been released in v1.34.0, available on nuget.org

1reaction
worthy7commented, May 25, 2018

Could we try to get this released ASAP please? I cannot do any work at home. I even synced my clock with time.google.com lol

Read more comments on GitHub >

github_iconTop Results From Across the Web

JWT token not yet valid
I've got a google sign in button in my angular web app. After a successful sign in, I store the user profile and...
Read more >
CSIAQ0201E The JSON Web Token (JWT) not yet valid.
CSIAQ0201E The JSON Web Token (JWT) not yet valid. Explanation. The not before (nbf) claim indicates the time before which the JWT must...
Read more >
Solved: Facing issue with Verify JWT Policy
If the issuing system has a clock which is skewed from the actual time, then it can issue a JWT that is not...
Read more >
Troubleshooting JWT validation
Make sure the JWT contains valid JSON. Check that the JWT header has the "alg" field and is set to one of the...
Read more >
AccessToken is not (yet) valid
Of course the token is not yet valid, but how is this possible!? I first create & get the token and then I'm...
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