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

JWT decode error - parameter seconds #1479

Open
aroy314 opened this issue Dec 17, 2024 · 0 comments
Open

JWT decode error - parameter seconds #1479

aroy314 opened this issue Dec 17, 2024 · 0 comments

Comments

@aroy314
Copy link

aroy314 commented Dec 17, 2024

Current behavior

I'm using Version 2.0-preview.8
The decoding of my JWT token sends me an error :
image

It's working when i decode it on jwt.io
image

This might be related to "iat" and "exp" being encoded in miliseconds, not seconds (ex :1734530610991).

How to reproduce it (as minimally and precisely as possible)

  • Open DevToys Version 2.0-preview.8
  • Go to "Encodeur JWT / Décodeur"
  • Paste this JWT : eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzc29waGllIiwidXVpZCI6ImEzYWJjYjAyLTUxNzMtNGFhZi1hYTQ1LTgwZWNlYjgzZjQ0NSIsImlhdCI6MTczNDQ0NDIxMDk5MSwiZXhwIjoxNzM0NTMwNjEwOTkxLCJoYXNfd2Vic2l0ZSI6dHJ1ZSwiaGFzX2VyZXAiOmZhbHNlLCJoYXNfYm9va2luZ2VuZ2luZSI6ZmFsc2UsImhhc193aWRnZXQiOmZhbHNlLCJoYXNfb2RpdG9yIjpmYWxzZX0.rSGdAmojDGIKOW6iTN40dh_5Rw9cJKzJ7wJaJ-wNn2k

Expected behavior

I guess the best behavior in this case should be to handle displaying the raw decoded content without parsing the date ?

Screenshots

No response

Workaround

No response

Affected platforms

Windows

Affected DevToys kind

DevToys (app with GUI)

DevToys Version

Version 2.0-preview.8

Relevant Assets/Logs

2024-12-17T15:09:12.4904525+01:00	Error	[DevToys.Tools.Tools.EncodersDecoders.JsonWebToken.JsonWebTokenDecoderGuiTool]	[0]	Invalid token detected
Valid values are between -62135596800 and 253402300799, inclusive. (Parameter 'seconds')
System.ArgumentOutOfRangeException: Valid values are between -62135596800 and 253402300799, inclusive. (Parameter 'seconds')
   at System.DateTimeOffset.FromUnixTimeSeconds(Int64 seconds)
   at DevToys.Tools.Helpers.JsonWebToken.JsonWebTokenDecoderHelper.ProcessClaims(ReadOnlySpan`1 data, IEnumerable`1 claims) in E:\Publish\submodules\DevToys.Tools\src\DevToys.Tools\Helpers\JsonWebToken\JsonWebTokenDecoderHelper.cs:line 207
   at DevToys.Tools.Helpers.JsonWebToken.JsonWebTokenDecoderHelper.DecodeTokenAsync(DecoderParameters decodeParameters, TokenParameters tokenParameters, ILogger logger, CancellationToken cancellationToken) in E:\Publish\submodules\DevToys.Tools\src\DevToys.Tools\Helpers\JsonWebToken\JsonWebTokenDecoderHelper.cs:line 92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant