-
Notifications
You must be signed in to change notification settings - Fork 405
Description
I'm trying to integrate with Amazon Cognito behind an AWS load balancer. Cognito supplies a JWT, but the token includes padding. Yes, this makes it a malformed token, but it's not a token which I can change. (Specifically, when running behind an Application Load Balancer, I need to validate the x-amzn-oidc-data
header. Infuriatingly, they also provide a second JWT, which is not malformed, but doesn't include some specific details which I need...)
v3.2.2 included PR#33, which changes how the library handles this situation. Prior to the change, the Base64 text was correctly parsed, as the decoded expected padding (and this was added if it was missing). Now, the base64 parser returns an error ("illegal base64 data").
Stripping the padding before passing to the library allows the base64 deserialisation to succeed, but the signature then fails to validate.
Currently my only option (other than looking for a different library) seems to be to stick to v3.2.1... Any other suggestions would be very welcome!