Add claim with slash characters in token inline hook response

In the JSON response returned by a token inline hook, the path property uses / characters as the delimiter. The Okta documentation gives the following examples:

{ "op": "add", "path": "/claims/extPatientId", "value": "..." },
{ "op": "add", "path": "/claims/employee_profile/department_id", "value": "..." }

How can I include a claim whose name contains / characters, without the slashes being misinterpreted as path delimiters? To be specific, I need to specify the following claim: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name

Hi @mliu-st, you can specify a claim name to be a URI by escaping it as a JSON Pointer RFC 6901: JavaScript Object Notation (JSON) Pointer
For your example, you would specify the path as /claims/http:~1~1schemas.xmlsoap.org~1ws~12005~105~1identity~1claims~1name

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.