[英]Azure B2C custom policy conditional OrchestrationStep
我試圖根據我的自定義屬性的值來介紹新的業務流程步驟。 我的要求是,僅當myattribute(boolean attribute)的值設置為true時,我才想執行業務流程步驟。 myattribute的值設置為true或false。 我正在做這樣的事情。
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>False</Value>
<Value>extension_myattribute</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
但是,無論myattribute的值如何,都不會跳過此步驟。 我已將myattribute添加為AAD-UserReadUsingObjectId的OutPutClaims的一部分。 我可以在C#中看到extension_myattribute的值。
任何指向比較價值的示例的指針都會對我有很大幫助。
您嘗試做的事情應該可以工作,至少在入門包中有非常相似的示例。
<!-- 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>
xsd還明確提及“ true”和“ 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>
也許您的要求尚未確定? 還是您在混合屬性和要求?
對於ClaimEquals前提條件,第一個<Value />
必須設置為聲明類型,第二個<Value />
必須設置為聲明值:
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>extension_myattribute</Value>
<Value>False</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
對於布爾聲明,可能的值為“ True”和“ False”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.