APM: OAUTH2 JWT Token with groups claim
Hello and happy new year 😉
We use APM as OAuth Authorization Server to create JWT token for apps. One of our customers wants to use the MicroProfile JWT(MP-JWT) for his application, that needs some specific claims: https://github.com/eclipse/microprofile-jwt-auth/blob/master/spec/src/main/asciidoc/interoperability.asciidoc
One requirement is to encode the groups claim in JSON array:
"groups": ["red-group", "green-group", "admin-group", "admin"]
We now try to set the claim with groups from the Active Directory. With an iRule, I filtered the AD groups (from memberOf) and set a new APM variable (session.custom.groups) with this value:
["red-group", "green-group", "admin-group", "admin"]
When I now add a claim groups with %{session.custom.groups} as value, I see that string in my JWT token:
"groups": "[\"red-group\", \"green-group\", \"admin-group\", \"admin\"]"
So the value is escaped and has is in quotation marks.
Is there any chance to send claims as JSON array?
Any help would be appreciated.