Azure AD B2C Custom Policy with Sign Up Page Only

五迷三道 提交于 2019-12-24 16:57:04

问题


I want to create a custom policy in Azure AD B2C. I can't find such an example in the starterpack (https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack).

I checked this post Azure AD B2C Link to Sign Up Page (Not Sign In) and if I understand it correctly there is no url I can use of existing custom signup_signin policy to end up directly in Sign Up page. Creating "Sign up v2" flow works, but I need a custom one and coping code from the build in one and placing it to the LocalAccounts example from the starterpack doesn't work.

This is the UserJourney code downloaded from "Sign up v2" flow

    <UserJourney Id="B2CSignUp_V2"> <OrchestrationSteps> <OrchestrationStep 
    Order="1" Type="ClaimsProviderSelection" 
    ContentDefinitionReferenceId="api.idpselections.signup"> 
    <ClaimsProviderSelections> <ClaimsProviderSelection 
    TargetClaimsExchangeId="SignUpWithLogonEmailExchange" /> 
    </ClaimsProviderSelections> </OrchestrationStep> </OrchestrationSteps> 
    </UserJourney>

I tried to replace the OrchestrationStep 1 and 2 from the starterpack with the one here but it doesn't work.


回答1:


In your Custom policies, In the B2C_1A_TrustFrameworkBase.xml file replace the 1st Orchestration Step for the User Journey Id="SignUpOrSignIn" with the following Orchestration Step and you will be directly landed to Signup page -

<OrchestrationStep Order="1" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.idpselections.signup">
<ClaimsProviderSelections>
<ClaimsProviderSelection TargetClaimsExchangeId="SignUpWithLogonEmailExchange" />
</ClaimsProviderSelections>
</OrchestrationStep>



回答2:


Alternatively, you can:

  • Remove orchestration step 1
  • Remove the objectId precondition from orchestration step 2
  • Renumber the following orchestration steps

Such as:

<OrchestrationStep Order="1" Type="ClaimsExchange">
  <ClaimsExchanges>
    <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
  </ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="2" Type="ClaimsExchange">
  <ClaimsExchanges>
    <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
  </ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="3" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />


来源:https://stackoverflow.com/questions/56497567/azure-ad-b2c-custom-policy-with-sign-up-page-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!