繁体   English   中英

Azure B2C自定义策略条件编排步骤

[英]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的值。

任何指向比较价值的示例的指针都会对我有很大帮助。

您尝试做的事情应该可以工作,至少在入门包中有非常相似的示例。

https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/blob/f376b431dc0c7353faf52632d3d3f735ad5978a1/scenarios/source/aadb2c-ief-terms-of-use/SignUpOrSigninToUDateTime.xml

    <!-- 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM