作为一种变通方法,您可以添加先决条件步骤1 & 2再加入与客户错误页面,额外的步骤。
在下面的XML片段中,我已经添加了前提条件,仅在您的声明存在时运行步骤1 & 2,否则跳到下一步。 9月3日,只有在索赔不存在的情况下才运行前提条件,然后显示自定义页面。这只是一个例子,您可以添加自己的错误页面。
<OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
<Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="false">
<Value>{your claim name}</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsProviderSelections>
<ClaimsProviderSelection TargetClaimsExchangeId="FacebookExchange" />
<ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
</ClaimsProviderSelections>
<ClaimsExchanges>
<ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
</ClaimsExchanges>
</OrchestrationStep>
<!-- Check if the user has selected to sign in using one of the social providers -->
<OrchestrationStep Order="2" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="false">
<Value>{your claim name}</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="false">
<Value>registrationSource</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="FacebookExchange" TechnicalProfileReferenceId="Facebook-OAUTH" />
<ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
</ClaimsExchanges>
</OrchestrationStep>
<!-- Error message-->
<OrchestrationStep Order="3" Type="ReviewScreen" ContentDefinitionReferenceId="api.selfasserted">
<Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="true">
<Value>registrationSource</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
</OrchestrationStep>
<!-- Rest of the UserJourney -->
</OrchestrationSteps>
</UserJourney>
找到<ContentDefinitions>
元素,并添加以下XML
<ContentDefinition Id=" api.inputtoken.error ">
<LoadUri>~/tenant/default/selfAsserted.cshtml</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:selfasserted:1.1.0</DataUri>
<Metadata>
<Item Key="DisplayName">Collect information from user page</Item>
</Metadata>
</ContentDefinition>
更改LoadUri值以指向您的HTML错误页面
我期望这个由TechnicalProfile执行。我猜想发生的事情是,你正在得到索赔,这只是空的。在这种情况下,你需要额外的验证,你可以通过[](https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/blob/master /SocialAccounts/TrustFrameworkBase.xml#L35)元素的声明本身。 –
Saca
我对此并非100%,因此将其作为评论添加,希望其他人可以在此提供更确切的答案。 – Saca
谢谢@萨卡。我应该提到这些字段对用户是隐藏的(我已经更新了这个问题)。我尝试了,但没有奏效。 –
spottedmahn