What I am Doing:
var myArr= []; for (var i=0; i<1; i++) { var eachElement = {}; eachElement.Atr1= SourceArray1[i]; eachElement.Atr2 = SourceArray2[i]; eachElement.Atr3 = SourceArray3[i]; eachElement.Attr4 = 'abcd'; myArr.push(eachElement); } context.serVariable("myArr", JSON.stringify(myArr));
<CustomClaims> <Claim name="myArr" ref="myArr" /> </CustomClaims>
What I am expecting:
I am expecting to get the following JSON object after decoding the jwt
"myArr": [ { "Atr1": "abcd", "Attr2": "abcd@example.com", "Attr3": "+11111111", "Attr4": "abcd" } ]
What results I am getting:
I am getting following string after decoding the jwt
"myArr": "[{\"Attr1\":\"abcd\",\"Attr2\":\"abcd@example.com\",\"Attr3\":\"+11111111\",\"Attr4\":\"abcd\"}]"
Can any one please help me in understanding what I am doing wrong here ?
Solved! Go to Solution.
yes - I think what you want is to tell the CustomClaim that it should find a map. So something like this:
<CustomClaims> <Claim name="myArr" ref="myArr" type='map'/> </CustomClaims>
Can you try? and LMK ?