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

Decode issue #104

Open
phanindhraB opened this issue Jan 20, 2022 · 5 comments
Open

Decode issue #104

phanindhraB opened this issue Jan 20, 2022 · 5 comments

Comments

@phanindhraB
Copy link

phanindhraB commented Jan 20, 2022

I'm Sending the finalized JWT String in Header and expected to get a response as same
but it is changing the decode response
Screenshot 2022-01-20 at 11 22 40 AM

This is the cryptogram after encoding
eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUxMiJ9.eyJhbW91bnQiOiIxLjAwIiwiZGV2aWNlSWQiOiJGRjY0QUUwOS02NkVDLTQ3QTMtODkwQy01MkE0RjE1MzFEOTEiLCJjcmVkaXRvckFjY291bnQiOiIyNTUyNTI1MjIiLCJlbmRUb0VuZElkIjoiQ01DTE1VTTAyMDIyMDEyMDAwMDAwMSIsImRlYnRvckFjY291bnQiOiIxMjM0NTY3OCIsImN1cnJlbmN5IjoiTVVSIiwiY29uc2VudElkIjoiODgzNzkifQ.GiIAaPBxa-Rsf6AjYWDVPpfvlqpau_qkADGHixskS2knONHDQv8wK1MleCcr4MViRcSCoSFl195BhqI9Pp4yE31OFd_O59O7FSDY1jt7ZIfkdZa9YHxz9QMgq-rk3f7S4m_REThgrTEVo9DsbTWNuuhE2XuJtKbovFxTFF_4_zftXWfoQ9bufW9BbLeUWwzLrUPrTKrPpon6DEy5nV0Sy-dufCJKt9X3-79La-2xgqPSjtybrQMlGg78gaVQF7tjya6dTrPMQ8j-TIyeaRdRQIsJm8xOl99wOEP7wA6JwxSqQsjeUTXRHPIikixcPTs8oybEbCh5qCZULz-LnOXYJw

if i see this decoding cryptogram in JWT, it is changing the json response

Screenshot 2022-01-20 at 11 26 00 AM

@phanindhraB
Copy link
Author

@dannys42 @bluk @e0 @mbarnach any response on the decoded object ??

@mbarnach
Copy link
Member

@phanindhraB What is different? I cannot spot the difference here. Do you mean your JWT is altered in anyways? But between what and what?

@phanindhraB
Copy link
Author

@mbarnach I mean, passing Claim struct object with an order for creating encoding object, if I decode the object using JWT, the order of the Claim struct object is changing. you can see the above comment.

@mbarnach
Copy link
Member

@phanindhraB JSON are coded as dictionary, so order is not preserved. If you are using a decodable struct, it shouldn't matter. Otherwise, you will have to provide your own encoder/decoder with ordered dictionary.

@josephjoeljo
Copy link

I am running into a similar issue. I've created my own encoding/decoding function in the Claims struct I made. I am getting a value not found.

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

No branches or pull requests

3 participants