Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Changing the Decoding type to Raw URL encoding. #51

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hprabh
Copy link

@hprabh hprabh commented Jul 14, 2023

Changing the Decoding type to Raw URL encoding.

  • JWTs make use of the base64url encoding as defined in RFC 4648 [RFC4648]. As allowed by Section 3.2 of the RFC, this specification mandates that base64url encoding when used with JWTs MUST NOT use padding. The reason for this restriction is that the padding character ('=') is not URL safe. [https://www.ietf.org/archive/id/draft-jones-json-web-token-02.html#rfc.section.7)].

  • The base64 Std / URL parsers expect a padding character (=), which is optional and the absence of which can lead to unexpected failures. (https://pkg.go.dev/encoding/base64). There is a github issue which talks about the same - Base64 decoding not working correctly golang/go#46257

  • Also added extra logging for debugging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant