I’m using Token inline hooks to add custom parameters to access token. I can add simple values, but I have a requirement to add a JSON to my JWT, as follows.
"permissions": [
{
"authority": "{\"userId\":30,\"uniId\":1,\"role\":\"STUDENT\"}"
},
{
"authority": "{\"usertId\":2,\"uniId\":1,\"role\":\"INSTRUCTOR\"}"
}
]
Documentation gives samples to add elements to an array, but I couldn’t find a way to add a Json structure like this.
Any clue?
Thanks
ps:
The closest I came was to have a structure like this. A string array. For now I’m planning to go ahead with this. But curious to know any way of adding a Json
{
"commands": [
{
"type": "com.okta.access.patch",
"value": [
{
"op": "add",
"path": "/claims/user-permissions",
"value": ["userId:30,uniId:1,role:STUDENT", "userId:2,uniId:1,role:ADMIN", "userId:1,uniId:1,role:VIEWER", "userId:4,uniId:1,role:EDITOR"]
}
]
}
]
}