-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fail use jwt_parser:base64_decode to decode when upgrade kong 3.4.2 to 3.6.0 #12676
Comments
Not sure whether if #11569 affectted it, we need to check |
We have created a ticket to track this issue (KAG-3952), thanks for your report. |
jwt token should be encoded with Base64URL algorithm, which means that we should replace '+' to '-' and '/' to '-'. The variable |
You can change the code like this:
|
Thanks, the problem has already been solved.
|
@chronolaw Will this change be added to the source code?
|
Is there an existing issue for this?
Kong version (
$ kong version
)kong 3.6
Current Behavior
In Kong 3.6.0
When I use kong.plugins.jwt.jwt_parser:base64_decode, it will meet exception : nil,invalid input.
2024/03/01 16:14:10 [debug] 1277#0: *1286 [lua] sso.lua:119: jwt_decoder:base64_decode(key) = nilinvalid input
Expected Behavior
In Kong 3.4.2
When I use kong.plugins.jwt.jwt_parser:base64_decode, it will decode successfully.
Steps To Reproduce
2024/03/01 16:14:10 [debug] 1277#0: *1286 [lua] sso.lua:119: jwt_decoder:base64_decode(key) = nilinvalid input
Anything else?
#11569 refactor the code about jwt_parser:base64_decode, so is it expected that such an error will occur?
The text was updated successfully, but these errors were encountered: