首页 > 解决方案 > Azure AD B2C 登录自定义策略记住用户

问题描述

我们在 Azure AD B2C 中有一个登录自定义策略设置,客户使用它来登录我们的应用程序。在标准 B2C 策略中,用户会被记住,并提供一个菜单,其中包含从特定机器登录的电子邮件地址列表(以及忘记它们的选项),如下面的屏幕截图所示:

用户列表

我们的自定义登录策略有效,但用户每次都必须从他们的机器上重新输入他们的电子邮件地址。我们如何使用自定义策略实现相同的行为?

以下是技术简介:

<TechnicalProfile Id="SelfAsserted-LocalAccountSignin-Email">
  <DisplayName>Local Account Signin</DisplayName>
  <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  <Metadata>
    <Item Key="SignUpTarget">SignUpWithLogonEmailExchange</Item>
    <Item Key="setting.operatingMode">Email</Item>
    <Item Key="setting.showSignupLink">False</Item>
    <Item Key="setting.showContinueButton">True</Item>
    <Item Key="setting.showCancelButton">True</Item>
    <Item Key="EnforceEmailVerification">False</Item>
    <Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
  </Metadata>
  <IncludeInSso>false</IncludeInSso>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="signInName" />
  </InputClaims>
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="signInName" Required="true" />
    <OutputClaim ClaimTypeReferenceId="password" Required="true" />
    <OutputClaim ClaimTypeReferenceId="objectId" />
    <OutputClaim ClaimTypeReferenceId="authenticationSource" />
  </OutputClaims>
  <ValidationTechnicalProfiles>
    <ValidationTechnicalProfile ReferenceId="login-NonInteractive" />
  </ValidationTechnicalProfiles>
  <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
</TechnicalProfile>

编辑:

在试用了当前在 Azure AD B2C 中处于预览阶段的新“用户流程”之后,似乎提供了两种不同版本的登录用户旅程:

因此, Sign in v2似乎是在自定义策略中用于登录用户旅程的版本,因为它是允许 UI 自定义的版本。

标签: azure-active-directoryazure-ad-b2cidentity-experience-framework

解决方案


SignInV1 与 SignInV2

内置策略已更名为用户流。Azure Ad B2C 的新 ui 正在进入 GA。它有一些 v2 用户流,目前处于预览阶段,并将在适当的时候移至 GA。

SignInv1 和 SignInv2 用户流的工作方式有所不同。SignIn v1 以“交互方式”与 Azure Active Directory (AAD) 的默认登录体验联合,该体验具有“让我登录”(KMSI) 功能。SignInV2 具有 UX 可定制性的附加功能。为 B2C 提供与 AAD 的“非交互式”联合。

由于这种可定制性,目前 signinv1 和 v2 - KMSI - 强制密码重置之间存在功能差距。

有计划开发这些功能。

自定义政策

此页面将介绍如何为自定义策略启用 KMSI。 https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-reference-kmsi-custom


推荐阅读