Reputation: 175
I am trying to introduce new Orchestration Step based on the value of my custom attribute. My requirement is I want to execute the a orchestration step only if the value of myattribute(boolean attribute) is set to true. The value of myattribute is either set to true or false. I am doing something like this.
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>False</Value>
<Value>extension_myattribute</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
But this step is not skipped irrespective of the value of myattribute. I have added the myattribute as part of the OutPutClaims of AAD-UserReadUsingObjectId. I am able see the value of extension_myattribute in the C#.
Any pointers to examples where value is compared will help me a lot.
Upvotes: 4
Views: 3060
Reputation: 14634
For a ClaimEquals precondition, the first <Value />
must be set to the claim type and the second <Value />
must be set to the claim value:
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>extension_myattribute</Value>
<Value>False</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
For a boolean claim, the possible values are "True" and "False".
Upvotes: 10
Reputation: 18526
What you try do do should work, at least there are very similar examples in the starter pack.
<!-- Check if the user has selected to sign in using one of the social providers -->
<OrchestrationStep Order="2" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="false">
<Value>authenticationSource</Value>
<Value>socialIdpAuthentication</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="FacebookExchange" TechnicalProfileReferenceId="Facebook-OAUTH" />
<ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="SelfAsserted-Input-ToU-LocalAccountSignUp" />
</ClaimsExchanges>
</OrchestrationStep>
The xsd also explicitly mentions "true" and "false"
<xs:attribute use="required" name="ExecuteActionsIf" type="xs:boolean" >
<xs:annotation>
<xs:documentation>
Specifies if the actions in this precondition should be performed if the test is true or false.
</xs:documentation>
</xs:annotation>
</xs:attribute>
Maybe your claim is not actually set yet? Or are you mixing attrributes and claims?
Upvotes: 0