Closed mstruk closed 1 year ago
@scholzj Thanks for pointing this out. Upon a second look I realised that the fix is not good as it potentially introduces backwards compatibility issues. I'll describe the problem in more detail, and I'm working on a proper fix.
@tombentley I hope I adequately addressed the comments. WDYT?
When extracting a user id from JWT token by using
oauth.username.claim
oroauth.fallback.username.claim
it only worked for top level attributes, not for nested attributes. For example, by configuring:"oauth.username.claim=auth.userid"
, and given a JWT token:Extraction would not find 'userid' key under top level 'auth' object, rather it was looking for 'auth.userid' top level key.
This PR adds an option to use JsonPath to target nested attributes. If the claim specification starts with an opening square bracket '[', it is interpreted as a JsonPath query. Otherwise, it is interpreted as a top level attribute name.