Azure B2C自定义策略注册UI-删除显示名称

ctehm74n  于 2023-10-22  发布在  其他
关注(0)|答案(3)|浏览(91)

我已经使用LocalAndSocialAccount入门包为Azure AD B2C设置了自定义策略。我正在尝试从注册用户界面中删除显示名称。我以前读过,这可以通过删除LocalAccountSignUpWithLogonEmail技术配置文件中的<OutputClaim ClaimTypeReferenceId="displayName" />来完成。
但这似乎对我不起作用。有谁能提供任何关于修复的见解吗?
我的TrustFrameworkExtensions.xml:

<ClaimsProvider>
      <DisplayName>Local Account</DisplayName>
      <TechnicalProfiles>
        <!--Local account sign-up page-->
        <TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
          <OutputClaims>
          <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
          <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
          <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
          <OutputClaim ClaimTypeReferenceId="givenName" />
          <OutputClaim ClaimTypeReferenceId="surName" />
          <OutputClaim ClaimTypeReferenceId="dateOfBirth" />
          <OutputClaim ClaimTypeReferenceId="verificationCode"/>
        </OutputClaims>
      </TechnicalProfile>
      </TechnicalProfiles>
</ClaimsProvider>

我的SignUporSignIn.xml:

<RelyingParty>
    <DefaultUserJourney ReferenceId="SignUpOrSignIn" />
    <TechnicalProfile Id="PolicyProfile">
      <DisplayName>PolicyProfile</DisplayName>
      <Protocol Name="OpenIdConnect" />
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="givenName" />
        <OutputClaim ClaimTypeReferenceId="surname" />
        <OutputClaim ClaimTypeReferenceId="email" />
        <OutputClaim ClaimTypeReferenceId="verificationCode" DefaultValue=""/>
        <OutputClaim ClaimTypeReferenceId="dateOfBirth" />
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />

      </OutputClaims>
      <SubjectNamingInfo ClaimType="sub" />
    </TechnicalProfile>
</RelyingParty>
jw5wzhpr

jw5wzhpr1#

你需要把它从你的底座上取下来
在文件TrustFrameworkBase.xml第631行中,

<TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
  <DisplayName>Email 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>
  </Metadata>
  <CryptographicKeys>
    <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
  </CryptographicKeys>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="email" />
  </InputClaims>
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="objectId" />
    <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
    <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
    <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
    <OutputClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" DefaultValue="true" />
    <OutputClaim ClaimTypeReferenceId="authenticationSource" />
    <OutputClaim ClaimTypeReferenceId="newUser" />

    <!-- Optional claims, to be collected from the user -->
    <OutputClaim ClaimTypeReferenceId="displayName" />
    <OutputClaim ClaimTypeReferenceId="givenName" />
    <OutputClaim ClaimTypeReferenceId="surName" />
  </OutputClaims>
  <ValidationTechnicalProfiles>
    <ValidationTechnicalProfile ReferenceId="AAD-UserWriteUsingLogonEmail" />
  </ValidationTechnicalProfiles>
  <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
</TechnicalProfile>

必须删除<OutputClaim ClaimTypeReferenceId="displayName" />

chhkpiq4

chhkpiq42#

这是因为您的技术配置文件与此文件的“基础”文件合并。因此,由于它存在于基地,它不工作。要么更改您的技术配置文件ID,使其不与基础文件中的ID合并,要么删除基础文件中的输出声明。

wydwbb8l

wydwbb8l3#

如果您正在使用新的政策,只需评论
<DisplayClaim ClaimTypeReferenceId="displayName" Required="true" />
LocalAccountSignUpWithLogonEmail技术简介中。

相关问题