An Equality claims transformation compares a claim defined in the policy schema to a fixed value expressed in a ‘CompareTo’ parameter that is part of its policy definition. Other parameters control whether the comparison should be case sensitive and whether to test for equality or inequality. The result of the comparison is returned as a Boolean claim.
InputClaims |
TransformationClaimType |
Description |
inputClaim1 |
The claim to be compared |
InputParameters |
Id |
DataType | Value |
compareTo |
string | The string to which the claim will be compared |
ignoreCase |
boolean | The string ‘true’ or the string ‘false’ |
operator |
string | Either ‘EQUAL’ or ‘NOT EQUAL’ |
OutputClaims |
TransformationClaimType |
Description |
outputClaim |
The booklean result of the comparison |
Example |
This example defines a ClaimsTransformation of the ‘Equality’ type called ‘LocalIdpTransform’. An claim called ‘loginIdp’ in the policy Schema is compared to a ‘compareTo’ parameter configured to be ‘EmailLocalAcount’. The comparison will not be case-sensitive. If the input claim equals the configured parameter, the transform will return a Boolean claim called ‘isIdpLocal’ with the string value ‘true’; otherwise it returns ‘false’.
<ClaimsTransformation Id="LocalIdpTransform" TransformationMethod="Equality"> <InputClaims> <InputClaim ClaimTypeReferenceId="loginIdp" TransformationClaimType="inputClaim1" /> </InputClaims> <InputParameters> <InputParameter Id="compareTo" DataType="string" Value="EmailLocalAccount" /> <InputParameter Id="ignoreCase" DataType="string" Value="true" /> <InputParameter Id="operator" DataType="string" Value="EQUAL" /> </InputParameters> <OutputClaims> <OutputClaim ClaimTypeReferenceId="isIdpLocal" TransformationClaimType="outputClaim" /> </OutputClaims> </ClaimsTransformation>