-
Notifications
You must be signed in to change notification settings - Fork 108
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
Supporting a JWS token encoded with BASE64 #84
Conversation
from what I see from my AWS ALB headers, the I've fixed my problem by just adding |
I've reached out to AWS, will follow up. |
In the mean time, I don't plan to accept this PR and don't want to lead you on. I'll continue poking AWS and let you know. See: #49 |
I just got an update from AWS:
|
@omsmith @joetjef any updates from AWS on this? Just bumping into this issue and unable to progress. Allowing the padding with: -var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;
+var JWS_REGEX = /^[a-zA-Z0-9\-_=]+?\.[a-zA-Z0-9\-_=]+?\.([a-zA-Z0-9\-_=]+)?$/; Solves everything. (Yeah, I've read through #49). The workaround is pretty ugly and duplicates everything from |
Any update on this from AWS? We've also ran into the issue on our end. AWS support are saying "working as designed". |
|
@panva : yes, you can just strip the padding but the signed value changes and the signature becomes invalid, so if i'm passing the token upstream to other services either:
|
Ah right, the signed value is not the binary contents but the serialized one 🤦♂. Ignore my comment. AWS should fix this if they claim what they produce is a JWT. base64url with padding is not a valid JWT/JWS. |
June 2020 - I've come across this padding issue in numerous AWS area's not just JWT |
AWS response to the issue in November 2020:
|
Build bugs and ignore standards |
Since this is a known issue and you guys cannot get it fixed within 2 years, why don't you guys add more than a single sentence in the documentation that explains in more detail what issues a developer is going to run into when it comes to decoding the JWT. All your public documentation mentions is that it has padding characters, it doesn't mention that you guys are not actually following proper standards when it comes to JWT tokens, and so the libraries your documentation recommends else where at places like jwt.io will not actually work as intended. This cost me hours and hours of my time. |
Currently, AWS ALB makes a JWT token with base64 (not base64url encoding).
Since node-jws very strictly checks the format of a token, the JWT token made by ALB cannot pass verification.
As a workaround, I added an option "base64".
If the "base64" option is true, characters used in the base64 encoding are checked instead of it of the base64url encoding.