如何在Azure AD B2C中创建仅电子邮件页面? [英] How to create an email only page in Azure AD B2C?

查看:48
本文介绍了如何在Azure AD B2C中创建仅电子邮件页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在登录页面的前面有一个页面,其中只有一个电子邮件地址字段和一个按钮.用户单击该按钮后,他们会转到另一个页面,可以在其中输入用户名和密码并登录.在B2C中可以这样做吗?

I would like to have a page in front of my sign in page where there is only an email address field and a button. Once the user clicks the button, they go to another page where they can enter their username and password and sign in. Is this possible in B2C?

仅电子邮件页面:

登录页面:

步骤1.在TrustFrameworkBase.xml文件中,将输入限制添加到signInName声明类型中,以便只能在第一页上输入电子邮件地址.

Step 1. In the TrustFrameworkBase.xml file, add an input restriction to the signInName claim type, so that only an e-mail address can be entered on the first page.

<!-- Claims needed for local accounts. -->
      <!--<ClaimType Id="signInName">
        <DisplayName>Sign in name</DisplayName>
          <DisplayName>Email address</DisplayName>
        <DataType>string</DataType>
        <UserHelpText />
        <UserInputType>TextBox</UserInputType>
      </ClaimType>-->

        <ClaimType Id="signInName">
            <DisplayName>Email address</DisplayName>
            <DataType>string</DataType>
            <UserHelpText/>
            <UserInputType>TextBox</UserInputType>
            <Restriction>
                <Pattern RegularExpression="^[a-zA-Z0-9.!#$%&amp;'^_`{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" HelpText="Please enter a valid email address." />
            </Restriction>
        </ClaimType>

步骤2.在TrustFrameworkBase.xml文件中,将另一个技术配置文件添加到本地帐户声明"提供程序,提示输入电子邮件地址.

Step 2. In the TrustFrameworkBase.xml file, add another technical profile to the Local Account claims provider, which prompts for the e-mail address.

 <ClaimsProvider>
      <DisplayName>Local Account</DisplayName>
      <TechnicalProfiles>
          <TechnicalProfile Id="SelfAsserted-LocalAccountSignin-EmailOnly">
              <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="ContentDefinitionReferenceId">api.selfasserted</Item>
              </Metadata>
              <IncludeInSso>false</IncludeInSso>
              <OutputClaims>
                  <OutputClaim ClaimTypeReferenceId="signInName" Required="true" />
              </OutputClaims>
              <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
          </TechnicalProfile>
        <TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
...

步骤3.在第一个编排步骤中,在TrustFrameworkBase.xml文件中,将SelfAsserted-LocalAccountSignin-EmailOnly添加到SignUpOrSignIn用户旅程中.

Step 3. In the TrustFrameworkBase.xml file, add SelfAsserted-LocalAccountSignin-EmailOnly to the SignUpOrSignIn user journey as the first orchestration step.

<UserJourneys>
    <UserJourney Id="SignUpOrSignIn">
      <OrchestrationSteps>
          <OrchestrationStep Order="1" Type="ClaimsExchange">
              <ClaimsExchanges>
                  <ClaimsExchange Id="LocalAccountSigninEmailOnlyExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-EmailOnly" />
              </ClaimsExchanges>
          </OrchestrationStep>
        <OrchestrationStep Order="2" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
          <ClaimsProviderSelections>
            <ClaimsProviderSelection TargetClaimsExchangeId="FacebookExchange" />
            <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
          </ClaimsProviderSelections>
          <ClaimsExchanges>
            <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
          </ClaimsExchanges>
        </OrchestrationStep>

我仍然提示输入密码(CSS隐藏了该字段):

I still get prompted for a password (CSS is hiding the field):

推荐答案

可以为此分页"操作实施自定义策略使用 LocalAccounts入门包如下.

  1. TrustFrameworkBase.xml 文件,将输入限制添加到

    <ClaimType Id="signInName">
      <DisplayName>Email address</DisplayName>
      <DataType>string</DataType>
      <UserHelpText/>
      <UserInputType>TextBox</UserInputType>
      <Restriction>
        <Pattern RegularExpression="^[a-zA-Z0-9.!#$%&amp;'^_`{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" HelpText="Please enter a valid email address." />
      </Restriction>
    </ClaimType>
    

    1. TrustFrameworkBase.xml 文件中,将另一个技术资料添加到
    1. In the TrustFrameworkBase.xml file, add another technical profile to the Local Account claims provider, which prompts for the e-mail address.

    <TechnicalProfile Id="SelfAsserted-LocalAccountSignin-EmailOnly">
      <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="ContentDefinitionReferenceId">api.selfasserted</Item>
      </Metadata>
      <IncludeInSso>false</IncludeInSso>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="signInName" Required="true" />
      </OutputClaims>
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
    </TechnicalProfile>
    

    1. TrustFrameworkBase.xml 文件中,将 SelfAsserted-LocalAccountSignin-EmailOnly 添加到
    1. In the TrustFrameworkBase.xml file, add SelfAsserted-LocalAccountSignin-EmailOnly to the SignUpOrSignIn user journey as the first orchestration step.

    <UserJourney Id="SignUpOrSignIn">
      <OrchestrationSteps>
        <OrchestrationStep Order="1" Type="ClaimsExchange">
          <ClaimsExchanges>
            <ClaimsExchange Id="LocalAccountSigninEmailOnlyExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-EmailOnly" />
          </ClaimsExchanges>
        </OrchestrationStep>
        <OrchestrationStep Order="2" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
          <ClaimsProviderSelections>
            <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
          </ClaimsProviderSelections>
          <ClaimsExchanges>
            <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
          </ClaimsExchanges>
        </OrchestrationStep>
        ...
    

    这篇关于如何在Azure AD B2C中创建仅电子邮件页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆