简体   繁体   English

完成忘记密码后,Azure 自定义策略 B2c 如何重定向到注册页面?

[英]Azure custom policy B2c after completing forgot password how to redirect to signup page?

In my sign-up form, I have a forgot password link if the user clicks on that link forgot password flow will start and the user is able to change his password but it's redirecting to the website's home page.在我的注册表单中,我有一个忘记密码链接,如果用户单击该链接忘记密码流程将启动,并且用户可以更改他的密码,但它会重定向到网站的主页。

Explanation of issue:问题说明:

  1. user opens the site www.abc.com用户打开网站www.abc.com
  2. Clicks on signup/signin button.单击注册/登录按钮。
  3. Redirects to B2c signup form there we have forgotten password link重定向到 B2c 注册表单,那里我们忘记了密码链接
  4. User clicks forgot password then email validation screen will come after validation user is able to change the password but redirected to www.abc.com I want users should be able to redirect to the signup/sign-in page mainly step 3 could you please guide me on this?用户点击忘记密码然后电子邮件验证屏幕将出现在验证用户能够更改密码但重定向到www.abc.com我希望用户应该能够重定向到注册/登录页面主要步骤 3 请指导我在这?
  • Code: SignUpOrSignInWithPhoneOrEmail is my default userjourney in step 3 forgotpassword:代码:SignUpOrSignInWithPhoneOrEmail 是我在第 3 步忘记密码的默认用户旅程:

在此处输入图片说明

  • Orchestration order 3:编排顺序 3:
    
     <OrchestrationStep Order="3" Type="InvokeSubJourney">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
                  <Value>isForgotPassword</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <JourneyList>
                <Candidate SubJourneyReferenceId="PasswordReset" />
              </JourneyList>
            </OrchestrationStep>
    
    Complete Userjourney lines
    
     <UserJourney Id="SignUpOrSignInWithPhoneOrEmail">
          <OrchestrationSteps>
            <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="signuporsignin-phone-email">
              <ClaimsProviderSelections>
                <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninPhoneEmailExchange" />
                <ClaimsProviderSelection TargetClaimsExchangeId="SignUpWithEmail" />
                <ClaimsProviderSelection TargetClaimsExchangeId="SignUpWithPhone" />
                <ClaimsProviderSelection TargetClaimsExchangeId="ChangePhoneNumber" />
                <ClaimsProviderSelection TargetClaimsExchangeId="FacebookExchange" />
                <ClaimsProviderSelection TargetClaimsExchangeId="GoogleExchange" />
                <ClaimsProviderSelection TargetClaimsExchangeId="LinkedInExchange" />
                <ClaimsProviderSelection TargetClaimsExchangeId="ForgotPasswordExchange" />
              </ClaimsProviderSelections>
              <ClaimsExchanges>
                <ClaimsExchange Id="LocalAccountSigninPhoneEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Phone-Email" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <OrchestrationStep Order="2" Type="ClaimsExchange">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>isLocalAccountSignIn</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>objectId</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <ClaimsExchanges>
                <ClaimsExchange Id="SignUpWithPhone" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonPhoneNumber" />
                <ClaimsExchange Id="SignUpWithEmail" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
                <ClaimsExchange Id="ChangePhoneNumber" TechnicalProfileReferenceId="PhoneInputPage-ChangePhoneNumberClaimsProviderSelection" />
                <ClaimsExchange Id="FacebookExchange" TechnicalProfileReferenceId="Facebook-OAUTH" />
                <ClaimsExchange Id="GoogleExchange" TechnicalProfileReferenceId="Google-OAuth2" />
                <ClaimsExchange Id="LinkedInExchange" TechnicalProfileReferenceId="LinkedIn-OAuth2" />
                <ClaimsExchange Id="ForgotPasswordExchange" TechnicalProfileReferenceId="ForgotPassword" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <OrchestrationStep Order="3" Type="InvokeSubJourney">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
                  <Value>isForgotPassword</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <JourneyList>
                <Candidate SubJourneyReferenceId="PasswordReset" />
              </JourneyList>
            </OrchestrationStep>
            <OrchestrationStep Order="4" Type="ClaimsExchange">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>isLocalAccountSignIn</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>isEmailSignUp</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>isPhoneSignUp</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
                <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
                  <Value>authenticationSource</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <ClaimsExchanges>
                <ClaimsExchange Id="AADUserReadUsingAlternativeSecurityId" TechnicalProfileReferenceId="AAD-UserReadUsingAlternativeSecurityId-NoError" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <OrchestrationStep Order="5" Type="ClaimsExchange">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>objectId</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>isLocalAccountSignIn</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>isEmailSignUp</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>isPhoneSignUp</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <ClaimsExchanges>
                <ClaimsExchange Id="SelfAsserted-Social" TechnicalProfileReferenceId="SelfAsserted-Social" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <OrchestrationStep Order="6" Type="InvokeSubJourney">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
                  <Value>isLocalAccountSignIn</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <JourneyList>
                <Candidate SubJourneyReferenceId="SignInWithPhoneOrEmail" />
              </JourneyList>
            </OrchestrationStep>
            <!-- -test changes//////////////////////////////////////////////////////////////////////////// -->
            <!-- For social IDP authentication, attempt to find the user account in the directory. -->
            <!-- Show self-asserted page only if the directory does not have the user account already (i.e. we do not have an objectId). 
              This can only happen when authentication happened using a social IDP. If local account was created or authentication done
              using ESTS in step 2, then an user account must exist in the directory by this time. -->
            <!-- This step reads any user attributes that we may not have received when authenticating using ESTS so they can be sent 
              in the token. -->
            <OrchestrationStep Order="7" Type="ClaimsExchange">
              <Preconditions>
                <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
                  <Value>authenticationSource</Value>
                  <Value>socialIdpAuthentication</Value>
                  <Value>hasFullProfile</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <ClaimsExchanges>
                <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <!-- The previous step (SelfAsserted-Social) could have been skipped if there were no attributes to collect 
                 from the user. So, in that case, create the user in the directory if one does not already exist 
                 (verified using objectId which would be set from the last step if account was created in the directory. -->
            <OrchestrationStep Order="8" Type="ClaimsExchange">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                  <Value>objectId</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <ClaimsExchanges>
                <ClaimsExchange Id="AADUserWrite" TechnicalProfileReferenceId="AAD-UserWriteUsingAlternativeSecurityId" />
              </ClaimsExchanges>
            </OrchestrationStep>
            <!-- - test changes/////////////////////////////////////////////////////////////////////////////////////////////////// -->
            <OrchestrationStep Order="9" Type="InvokeSubJourney">
              <Preconditions>
                <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
                  <Value>isChangePhoneNumber</Value>
                  <Action>SkipThisOrchestrationStep</Action>
                </Precondition>
              </Preconditions>
              <JourneyList>
                <Candidate SubJourneyReferenceId="ChangePhoneNumber" />
              </JourneyList>
            </OrchestrationStep>
            <OrchestrationStep Order="10" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
          </OrchestrationSteps>
          <ClientDefinition ReferenceId="DefaultWeb" />
        </UserJourney>

It looks like you used Transfer subjourney .看起来您使用了Transfer subjourney Have you tried your flow with Call subjourney?您是否尝试过使用 Call subjourney 的流程? Once Call subjourney ends the journey that called it continues to execute.一旦调用子旅程结束,调用它的旅程就会继续执行。 If that doesn't help then try to cut your yourney into reusable set of subjourneys and call the "main" flow from within the PasswordReset journey.如果这没有帮助,那么尝试将您的资金分成可重复使用的子旅程集,并从 PasswordReset 旅程中调用“主要”流程。 Don't forget to perform NullClaim claims transformation on the isPasswordReset claim to avoid neverending loop.不要忘记对 isPasswordReset 声明执行 NullClaim 声明转换以避免无休止的循环。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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