Azure自定义策略B2C-编排步骤

时间:2019-03-28 15:39:41

标签: azure azure-ad-b2c orchestration

我想知道我们如何编写策略以向用户显示“注册”按钮,该按钮可以将用户引导到另一个屏幕以使用电子邮件地址进行注册。我编写了一个自定义策略,该策略适用于Active Directory中具有帐户的用户。为此,业务流程的第一步是让用户使用电子邮件登录。如果找不到该用户,则会返回一条消息。

此后,我尝试编写第二个业务流程步骤,只有在上一个业务流程步骤中未找到用户时,才应执行该步骤。

<OrchestrationStep Order="2" Type="ClaimsExchange">
          <Preconditions>
            <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
              <Value>objectId</Value>
              <Action>SkipThisOrchestrationStep</Action>
            </Precondition>
          </Preconditions>
          <ClaimsExchanges>
                <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
          </ClaimsExchanges>
        </OrchestrationStep>

即使我收到未找到用户的消息,也不会执行该步骤。我该如何工作。我希望用户在同一屏幕上看到一个注册按钮。

有什么想法吗?

更新:我觉得无法找到用户的替代流程应在TechnicalProfile中而不是在业务流程步骤中处理。

1 个答案:

答案 0 :(得分:0)

您是否要显示具有“注册”链接的登录屏幕,该链接允许用户使用SerlfAssertedAttributeProvider进行注册?如果是这样,这是在LocalAccounts入门包(从TrustFrameworkBase.xml复制)中完成的操作:

    <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
      <ClaimsProviderSelections>
        <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
      </ClaimsProviderSelections>
      <ClaimsExchanges>
        <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
      </ClaimsExchanges>
    </OrchestrationStep>

    <OrchestrationStep Order="2" Type="ClaimsExchange">
      <Preconditions>
        <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
          <Value>objectId</Value>
          <Action>SkipThisOrchestrationStep</Action>
        </Precondition>
      </Preconditions>
      <ClaimsExchanges>
        <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
      </ClaimsExchanges>
    </OrchestrationStep>