Пользовательская политика Azure B2c после заполнения забыли пароль как перенаправить на страницу регистрации?

#azure #azure-ad-b2c-custom-policy #azure-policy

Вопрос:

В моей форме регистрации у меня есть ссылка «Забыли пароль», если пользователь нажмет на эту ссылку, начнется поток «Забыли пароль», и пользователь сможет изменить свой пароль, но он перенаправляется на домашнюю страницу веб-сайта.

Объяснение проблемы:

  1. пользователь открывает сайт www.abc.com
  2. Нажимает на кнопку регистрация/вход.
  3. Перенаправляет на форму регистрации B2c там мы забыли ссылку с паролем
  4. Пользователь нажимает «Забыли пароль», после проверки появится экран проверки электронной почты. Пользователь может изменить пароль, но перенаправлен на www.abc.com Я хочу, чтобы пользователи могли перенаправляться на страницу регистрации/входа в основном на шаге 3. Не могли бы вы, пожалуйста, помочь мне в этом?
  • Код: SignUpOrSignInWithPhoneOrEmail-это мой пользовательский журнал по умолчанию на шаге 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>
 

Ответ №1:

Похоже, вы использовали субъективную передачу. Вы пробовали свой поток с помощью Call subjourney? Как только вызов subjourney заканчивается, вызвавшее его путешествие продолжает выполняться. Если это не поможет, попробуйте разрезать свою учетную запись на многоразовый набор подчиненных и вызвать «основной» поток из набора паролей. Не забудьте выполнить преобразование утверждений NullClaim для утверждения isPasswordReset, чтобы избежать бесконечного цикла.