Azure B2C AD:本地帐户身份提供者是否必须基于用户名提供电子邮件地址?

时间:2018-08-08 18:00:16

标签: azure-ad-b2c

我想念什么吗?似乎无法进行设置,以便在注册过程中不需要电子邮件地址(甚至根本不需要输入电子邮件地址)?您只能禁用电子邮件验证。

我们可能根本不允许用户输入电子邮件地址。他们必须仅使用用户名注册。当然必须支持吗?

在我可以找到关于该主题的所有文档之后,我已经从头开始重做了整个过程两次。但是结果仍然相同。我首先创建一个新的B2C租户,并确保在“身份提供者”下,仅选择“用户名”作为“本地帐户”。然后,我转到“注册或登录策略”并创建一个自定义模板,然后单击“编辑”。然后,我确保将身份提供者设置为仅“用户ID注册”(和本地帐户),并且在“注册属性”以及“应用程序声明”中没有选择“电子邮件地址”。然后,我转到“页面UI自定义”,然后单击“本地帐户注册页面”。输入我的自定义URL。在“注册属性”下,列出了“电子邮件地址”。电子邮件地址根本不应该存在。当我单击“电子邮件地址”时,只有一个选项可将“需要验证”设置为“否”。可选拨动开关已禁用。所以我什至不能将其设为可选。

这里的要点是,当我使用“用户名”而不是“电子邮件”作为身份提供者时,它绝对不应该在我身上强加一个电子邮件地址。

如果您在2018年8月8日至今的Azure门户中尝试上述步骤,我相信您会发现相同的限制。在我看来,这似乎是个小虫,也许它沿线溜进了某个地方?

2 个答案:

答案 0 :(得分:1)

是的,可以使用自定义策略在不使用电子邮件的情况下在B2C中注册用户。 您可以按照提到的here步骤来创建自定义策略,并下载starter kit,其中包含有关如何修改策略以满足您的要求的示例。

下面是我用来注册用户而无需发送电子邮件的技术资料

 <TechnicalProfile Id="LocalAccountSignUpWithLogonName">
      <DisplayName>User ID signup</DisplayName>
      <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <Metadata>
        <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
        <Item Key="ContentDefinitionReferenceId">api.localaccountsignup</Item>
        <Item Key="LocalAccountType">Username</Item>
        <Item Key="LocalAccountProfile">true</Item>
        <Item Key="language.button_continue">Create</Item>
      </Metadata>
      <CryptographicKeys>
        <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
      </CryptographicKeys>
      <InputClaims>
        <InputClaim ClaimTypeReferenceId="signInName" />
      </InputClaims>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="objectId" Required="true" />
        <OutputClaim ClaimTypeReferenceId="signInName" Required="true" />
        <OutputClaim ClaimTypeReferenceId="email" />
        <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
        <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
        <OutputClaim ClaimTypeReferenceId="jobTitle" />
        <OutputClaim ClaimTypeReferenceId="postalCode" />
        <OutputClaim ClaimTypeReferenceId="city" />
        <OutputClaim ClaimTypeReferenceId="givenName" />
        <OutputClaim ClaimTypeReferenceId="surName" />
        <OutputClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" DefaultValue="true" />
        <OutputClaim ClaimTypeReferenceId="newUser" />
        <OutputClaim ClaimTypeReferenceId="authenticationSource" />
        <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
      </OutputClaims>
      <ValidationTechnicalProfiles>
        <ValidationTechnicalProfile ReferenceId="AAD-UserWriteUsingLogonName" />
      </ValidationTechnicalProfiles>
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
    </TechnicalProfile>

答案 1 :(得分:1)

允许您在基于用户名的帐户或基于电子邮件的帐户之间进行选择的切换开关,用于指示将用于登录的帐户。但是,这并不意味着在基于用户名的帐户中将不会收集电子邮件-只是不能使用电子邮件进行登录。

无论如何,即使对于基于用户名的帐户,也需要基本策略中的电子邮件地址来支持密码重置用户旅程。如果B2C没有收集电子邮件地址,则用户即使忘记了密码也无法重置密码。

如果您真的不想收集电子邮件,那么今天唯一的选择就是使用custom policies。在这种情况下,您将必须确定您希望如何支持密码重置(如果有的话)。

相关问题