Sitemap
The new control plane

“Identity is the new control plane”. Articles around Microsoft Entra ID, Entra External ID and Azure AD B2C. Click the “Archive” link at the bottom for more posts.

“ANDing” Preconditions in Azure AD B2C

--

Image of Boolean AND with two overlapping circles
Cecelia Vetter, via Wikimedia Commons

You often have this in a user journey:

<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>Claim A</Value>
<Value>True</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>Claim B</Value>
<Value>True</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>

where Claims A & B are boolean.

These act as an “OR”, so if Claim A is True, Claim B is never evaluated.

But what if both have to be True?

Get Rory Braybrook’s stories in your inbox

Join Medium for free to get updates from this writer.

I came across this in this sample:

<!--Sample: Check if datetime comparison is true and also the PasswordResetOn 
is presented in the user account.
If both of them are true, user doesn't need to reset the password-->
<ClaimsTransformation Id="CheckWhetherPasswordResetCanBeSkipped"
TransformationMethod="AndClaims">
<InputClaims>
<InputClaim ClaimTypeReferenceId="isPasswordResetOnGreaterThanNow"
TransformationClaimType="inputClaim1"/>
<InputClaim ClaimTypeReferenceId="isPasswordResetOnPresent"
TransformationClaimType="inputClaim2"/>
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="skipPasswordReset"
TransformationClaimType="outputClaim"/>
</OutputClaims>
</ClaimsTransformation>

Effectively, you AND Claim A and Claim B, putting the result in Claim C.

Then you just need a precondition:

<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>Claim C</Value>
<Value>True</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>

which achieves the desired result.

And if you need three claims to be true, just AND the result with Claim D etc.

There is also an “OR” and a “NOT” as you can see here.

All good!

--

--

Rory Braybrook
Rory Braybrook

Written by Rory Braybrook

NZ Microsoft Identity dude and MVP. Entra ID/Entra External ID/Azure AD B2C/VC. StackOverflow: https://bit.ly/2XU4yvJ Presentations: http://bit.ly/334ZPt5

The new control plane
The new control plane

Published in The new control plane

“Identity is the new control plane”. Articles around Microsoft Entra ID, Entra External ID and Azure AD B2C. Click the “Archive” link at the bottom for more posts.