Azure Ad B2C Orchestration Step Precondition not working as expected

Prudhvi Keertipati 1 Reputation point
2022-09-26T05:01:56.02+00:00

Problem: In a B2C Custom Policy, we wanted to skip an orchestration step if the values in precondition match. Below is the orchestration step with preconditions, Even though the two claims match, this step is still running.

Not sure If I'm doing anything wrong here. Please help. Thanks in advance!!

    <OrchestrationStep Order="8" Type="ClaimsExchange">  
      <Preconditions>  
         <Precondition Type="ClaimEquals" ExecuteActionsIf="true">  
              <Value>claim1</Value>  
              <Value>claim2</Value>  
              <Action>SkipThisOrchestrationStep</Action>  
            </Precondition>  
          </Preconditions>  
          <ClaimsExchanges>  
            <ClaimsExchange Id="DoSomeTask" TechnicalProfileReferenceId="DoSomeTask" />  
          </ClaimsExchanges>  
    </OrchestrationStep>  
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Prudhvi Keertipati 1 Reputation point
    2022-09-26T06:46:03.537+00:00

    After some research, I find out that Claim1 and Claim2 cannot be equal in Preconditions, even though they have the same values.

    Issue has been fixed by using a ClaimsTransformation for “CompareClaims” in the TechnicalProfile as below:

    Claims Transformation:

          <ClaimsTransformation Id="CheckClaimMatches" TransformationMethod="CompareClaims">  
            <InputClaims>  
              <InputClaim ClaimTypeReferenceId="claim1" TransformationClaimType="inputClaim1"/>  
              <InputClaim ClaimTypeReferenceId="claim2" TransformationClaimType="inputClaim2"/>  
            </InputClaims>  
            <InputParameters>  
              <InputParameter Id="operator" DataType="string" Value="EQUAL"/>  
              <InputParameter Id="ignoreCase" DataType="string" Value="true"/>  
            </InputParameters>  
            <OutputClaims>  
              <OutputClaim ClaimTypeReferenceId="CheckClaimEqual" TransformationClaimType="outputClaim"/>  
            </OutputClaims>  
          </ClaimsTransformation>  
    

    In the Technical Profile:

              <OutputClaimsTransformations>  
                <OutputClaimsTransformation ReferenceId="CheckClaimMatches" />  
              </OutputClaimsTransformations>  
    

    In the Orchestration Step:

                <Precondition Type="ClaimEquals" ExecuteActionsIf="true">  
                  <Value>CheckClaimEqual</Value>  
                  <Value>True</Value>  
                  <Action>SkipThisOrchestrationStep</Action>  
                </Precondition>  
    
    0 comments No comments

  2. Givary-MSFT 35,626 Reputation points Microsoft Employee Moderator
    2022-09-26T07:23:35.587+00:00

    @Prudhvi Keertipati Thank you for sharing the detailed steps/solution related to Azure Ad B2C Orchestration Step, it will help other community members looking for similar solutions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.