Azure active directory Azure AD B2C重置密码自定义策略及确认屏幕

Azure active directory Azure AD B2C重置密码自定义策略及确认屏幕,azure-active-directory,azure-ad-b2c,identity-experience-framework,Azure Active Directory,Azure Ad B2c,Identity Experience Framework,我已经在Azure AD B2C中设置了登录自定义策略,以便在登录流程中自定义GUI动态内容,并根据特定场景自定义品牌。此登录策略显示一个“忘记密码”链接,由我的应用程序处理该链接以启动另一个自定义密码重置策略的流程 在B2C提供的标准密码重置策略中,一旦用户重置了密码,就会出现一个额外的屏幕,指示密码已成功更改,并提供重新执行登录策略的链接。使用自定义策略,在重置密码后,将立即调用重定向url 是否可以在显示确认消息的屏幕上配置密码重置策略流程的附加步骤?我也为此苦苦挣扎了好几天。通过向扩展名

我已经在Azure AD B2C中设置了登录自定义策略,以便在登录流程中自定义GUI动态内容,并根据特定场景自定义品牌。此登录策略显示一个“忘记密码”链接,由我的应用程序处理该链接以启动另一个自定义密码重置策略的流程

在B2C提供的标准密码重置策略中,一旦用户重置了密码,就会出现一个额外的屏幕,指示密码已成功更改,并提供重新执行登录策略的链接。使用自定义策略,在重置密码后,将立即调用重定向url


是否可以在显示确认消息的屏幕上配置密码重置策略流程的附加步骤?

我也为此苦苦挣扎了好几天。通过向扩展名文件中添加以下内容,我成功地使其正常工作

  • 步骤3添加到密码重置用户旅程的现有编排步骤中
  • 
    
  • 在BuildingBlocks/claimschema中添加此索赔类型
  • 
    重新设置密码
    布尔值
    指示用户是否只是通过忘记密码功能重置密码。
    按钮
    
  • 添加上述新技术文件:LocalAccountWritePasswordChanged
  • 
    更改密码
    api.passwordchangesuccess
    返回登录
    准备再次登录。。。
    准备登录屏幕。
    
  • 修改依赖方文件,使其也具有新类型的outputClaimjustResetPassword
  • 
    
    我认为诀窍在于,这个新的技术概要文件有一个输出声明justResetPassword,因此它将尝试并捕获该值。因为它的数据类型是按钮,尽管它不显示。这一点我不是很清楚,但由于它正在发挥作用,我花了这么长时间才来到这里,我不会对此提出太多质疑

    您可能会注意到,这个新的技术概要文件引用了
    api.passwordchangesuccessuccess
    的ContentDefinition。这是我自己创建的自定义内容定义,为“密码重置消息”提供了更好的自定义标题。如果不需要对成功页面进行太多定制,您可以使用ContentDefinitionapi.selfasserted

    重置密码后的最终结果:

    这有帮助。但是,我们如何在此处显示登录/注册策略,而不是显示自定义内容?
    <UserJourney Id="PasswordReset">
      <OrchestrationSteps>
        <OrchestrationStep Order="1" Type="ClaimsExchange">
          <ClaimsExchanges>
            <ClaimsExchange Id="PasswordResetUsingEmailAddressExchange" TechnicalProfileReferenceId="LocalAccountDiscoveryUsingEmailAddress" />
          </ClaimsExchanges>
        </OrchestrationStep>
        <OrchestrationStep Order="2" Type="ClaimsExchange">
          <ClaimsExchanges>
            <ClaimsExchange Id="NewCredentials" TechnicalProfileReferenceId="LocalAccountWritePasswordUsingObjectId" />
          </ClaimsExchanges>
        </OrchestrationStep>
        <OrchestrationStep Order="3" Type="ClaimsExchange">
          <ClaimsExchanges>
            <ClaimsExchange Id="ShowSuccess" TechnicalProfileReferenceId="LocalAccountWritePasswordChanged" />
          </ClaimsExchanges>
        </OrchestrationStep>
        <OrchestrationStep Order="4" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
      </OrchestrationSteps>
      <ClientDefinition ReferenceId="DefaultWeb" />
    </UserJourney>
    
    
      <ClaimType Id="justResetPassword">
        <DisplayName>justResetPassword</DisplayName>
        <DataType>boolean</DataType>
        <UserHelpText>Indicates whether the user just reset their password via the forgot password feature.</UserHelpText>
        <UserInputType>Button</UserInputType>
      </ClaimType>
    
    
        <TechnicalProfile Id="LocalAccountWritePasswordChanged">
          <DisplayName>Changed 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.passwordchangesuccess</Item>
            <Item Key="language.button_continue">Back to Login</Item>
            <Item Key="language.initial_intro">Ready to login again...</Item>
            <Item Key="language.verifying_blurb">Preparing login screen.</Item>
            <!-- TODO: Hide cancel button -->
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="justResetPassword" DefaultValue="true" />
          </OutputClaims>
        </TechnicalProfile>
    
    
    <OutputClaim ClaimTypeReferenceId="justResetPassword" />