Generate a JWT with a Claim Type Array with Comma Separated Strings, Prevent Splitting

I want to send an array inside additional claims / claim with string values with comma inside and I dont want apigee to split this strings

<AdditionalClaims>
  <Claim name="output" type="string" ref="output_array" array="true"/> 
</AdditionalClaims>

My String Value = "name,surname,mail"

Expected Array = ["name,surname,mail"] but instead

Output= ["name","surname","mail"]

How can I proceed with this, with preventing it to split array with comma?

Solved Solved
0 2 2,747
1 ACCEPTED SOLUTION

The way I would do this is use a ref for the additional claims.

<AdditionalClaims ref='variable_holding_claims'/>

And then in the variable, insure you have something like this:

{
  "output" : ["name,surname,mail"]
}

I think this should work now. If not , it will be released shortly. (a few weeks)

View solution in original post

2 REPLIES 2

You could try array="false" and then adding the array wrapper yourself if you need the value in an array for some reason?

The way I would do this is use a ref for the additional claims.

<AdditionalClaims ref='variable_holding_claims'/>

And then in the variable, insure you have something like this:

{
  "output" : ["name,surname,mail"]
}

I think this should work now. If not , it will be released shortly. (a few weeks)