revomatico / kong-oidc

OIDC plugin for Kong
Apache License 2.0
110 stars 75 forks source link

Problem in parsing claim having type of table #36

Open deependera opened 1 year ago

deependera commented 1 year ago

Hi, There seems to be some problem with following piece of code in utils.lua script line 180

for i = 1, #header_names do local header, claim header = header_names[i] claim = header_claims[i] kong.service.request.clear_header(header) for j = 1, #sources do local source source = sources[j] if (source and source[claim]) then kong.service.request.set_header(header, source[claim]) break end end end

This piece of code will break if the claim has value type as table and because it will expect values to be either string or some other type and for this I think it need error handling