B2 C редирект после завершения пути пользователя - PullRequest
0 голосов
/ 13 июля 2020

Я использую настраиваемые политики в моем клиенте B2 C и обнаружил, что «Забыли пароль?» ссылка перенаправляет на страницу с ошибкой ( AADB2C90118 ). После исследования Inte rnet я обнаружил настраиваемую политику , которая позволяет мне встроить сброс пароля в политику регистрации или входа.

Это работает как шарм, проверка электронной почты и изменение пароля, как ожидалось. Моя проблема заключается в том, что я хочу перенаправить пользователя на страницу входа после успешного завершения сброса пароля.

Моя цель - перенаправить пользователя на страницу входа, чтобы он / она в состоянии петь с новыми полномочиями. Есть ли способ сбросить путь пользователя или перенаправить пользователя на страницу входа с помощью настраиваемых политик?

Вот Шаг , который проверяет, решил ли пользователь изменить свой пароль:

<OrchestrationStep Order="3" Type="ClaimsExchange">
      <Preconditions>
        <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
          <Value>isPasswordResetFlow</Value>
          <Action>SkipThisOrchestrationStep</Action>
        </Precondition>
      </Preconditions>          
      <ClaimsExchanges>
        <ClaimsExchange Id="NewCredentials" TechnicalProfileReferenceId="LocalAccountChangePasswordUsingObjectId" />
      </ClaimsExchanges>
    </OrchestrationStep>

А вот TechnicalProfile для изменения пароля:

<TechnicalProfile Id="LocalAccountChangePasswordUsingObjectId">
      <DisplayName>Change password</DisplayName>
      <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <Metadata>
        <Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
      </Metadata>
      <CryptographicKeys>
        <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
      </CryptographicKeys>
      <InputClaims>
        <InputClaim ClaimTypeReferenceId="objectId" />

      </InputClaims>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
        <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
      </OutputClaims>
      <ValidationTechnicalProfiles>
        <ValidationTechnicalProfile ReferenceId="AAD-UserWritePasswordUsingObjectId" />
      </ValidationTechnicalProfiles>
    </TechnicalProfile>

1 Ответ

0 голосов
/ 13 июля 2020

Вы можете использовать предварительное условие в пути в зависимости от того, сбросил ли пользователь пароль, чтобы запустить другой выбор поставщика утверждений, который предлагает то же самое, что и исходная страница входа / входа logi c.

        <OrchestrationStep Order="5" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
          <Preconditions>
            <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
              <Value>isPasswordResetFlow</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="6" Type="ClaimsExchange">
          <Preconditions>
            <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
              <Value>objectId</Value>
              <Action>SkipThisOrchestrationStep</Action>
            </Precondition>
            <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
              <Value>isPasswordResetFlow</Value>
              <Action>SkipThisOrchestrationStep</Action>
            </Precondition>
          </Preconditions>
          <ClaimsExchanges>
            <ClaimsExchange Id="FacebookExchange" TechnicalProfileReferenceId="Facebook-OAUTH" />
            <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
          </ClaimsExchanges>
        </OrchestrationStep>

Без этого образец не будет настраивать сеанс SM-AAD, и для последующих вызовов политики или тихих вызовов токенов в любом случае потребуется вход.

...