Hi @Meier, Maximilian , you can use the GetSingleValueFromJsonArray
transformation method. Here's an example of how to modify your custom policy to achieve this:
- Change the
TransformationMethod
in theClaimsTransformation
element toGetSingleValueFromJsonArray
. - Update the
InputClaim
element to use the correctClaimTypeReferenceId
. - Add an
InputParameter
element with theId
set toindex
and theValue
set to0
to extract the first element of the JSON array.
Here's the modified ClaimsTransformation
element:
<ClaimsTransformation Id="GetAccountId" TransformationMethod="GetSingleValueFromJsonArray">
<InputClaims>
<InputClaim ClaimTypeReferenceId="inputJson" TransformationClaimType="inputJsonClaim" />
</InputClaims>
<InputParameters>
<InputParameter Id="index" DataType="int" Value="0" />
</InputParameters>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="resultAccountId" TransformationClaimType="extractedClaim" />
</OutputClaims>
</ClaimsTransformation>
This should extract the account_id
from the JSON array and store it in the resultAccountId
claim.
Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James