Open ozonni opened 3 years ago
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
_
symbol