SimonSchneider / traefik-jwt-decode

Traefik forward auth implementation for JWT tokens
Apache License 2.0
29 stars 15 forks source link

Support nested json claim mapping #38

Open colcek opened 1 year ago

colcek commented 1 year ago

Some IDPs such as Keycloak uses nested JSON claims such as realm_access or address. Here is the example:

{
   "realm_access":{
      "roles":[
         "offline_access",
         "default-roles-tcl",
         "uma_authorization"
      ]
   },
   "address":{
      "city":"City"
   }
}

It would be good to define mapping like realm_access.roles:x-user-roles or address.city:city to extract values from nested structs.

colcek commented 1 year ago

Hey @SimonSchneider, are you still maintaining the repo?

SimonSchneider commented 1 year ago

Sorry about not responding to this, it's been a stressful spring with other obligations. I've had this on my todo list since the initial issue but I've just not gotten around to it. I'll try to look into it during the week but after quick review it looks like a good idea to support nested claims.

I've had this project quite far down on my priority list as I don't use it myself or at my current company. But am happy to keep up with some slow and steady maintenance for the users of it.