A ClaimToClaimEquality claims transformation compares the value of one claim defined in the policy schema to that of a second claim defined there. 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 first of two claims whose values are to be compared |
inputClaim2 |
The second of the claims to be compared |
InputParameters |
Id |
DataType | Value |
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 ‘ClaimToClaimEquality’ type called ‘EmailComparisonTransform’. An claim called ’email’ in the policy Schema is compared to a ‘secondaryEmail’ claim. The comparison will not be case-sensitive. If the input claims are the same, the transform will return a Boolean claim called ‘isEmailConsistent’ with the string value ‘true’; otherwise the string value will be ‘false’.
<ClaimsTransformation Id="EmailComparisonTransform" TransformationMethod="ClaimToClaimEquality"> <InputClaims> <InputClaim ClaimTypeReferenceId="email" TransformationClaimType="inputClaim1" /> <InputClaim ClaimTypeReferenceId="secondaryEmail" TransformationClaimType="inputClaim2" /> </InputClaims> <InputParameters> <InputParameter Id="ignoreCase" DataType="string" Value="true" /> <InputParameter Id="operator" DataType="string" Value="EQUAL" /> </InputParameters> <OutputClaims> <OutputClaim ClaimTypeReferenceId="isEmailConsistent" TransformationClaimType="outputClaim" /> </OutputClaims> </ClaimsTransformation>