-
Notifications
You must be signed in to change notification settings - Fork 15
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
Not all claims get converted #6
Comments
Will take a look to see if that is the issue. Thanks for submitting the issue! |
I might be completely wrong, but it seems as if only claims with string values are extracted. If you cast the claim to a string before storing it in the token, it should work. Good luck! |
I am facing the same issue and I think @Aleks-J is correct, claims with boolean, number or array/objects are not converted and are missing. |
I think the bug is in the headers only accept strings and the source code only allows string values. for claim, value in pairs(claims) do
if type(claim) == "string" and type(value) == "string" then
kong.service.request.set_header("X-Kong-JWT-Claim-" .. claim, value)
end
end Maybe instead of validating if the claim is a string, is better to transform the clam value to string for claim, value in pairs(claims) do
kong.service.request.set_header("X-Kong-JWT-Claim-" .. tostring(claim), tostring(value))
end |
I only get those headers set but jwt token has more, e.g.
client_id
or our custom claimaccount_code
I think it has something to do with
_
symbolThe text was updated successfully, but these errors were encountered: