首页 > 解决方案 > Azure AD B2C 自助服务密码重置显示错误的标题

问题描述

启用此新的自助服务密码重置时,它会在登录页面上显示错误的标题。

https://docs.microsoft.com/en-us/azure/active-directory-b2c/add-password-reset-policy?pivots=b2c-custom-policy#self-service-password-reset-recommended

它显示了这些:

Sign in with your social account
OR
Sign in with your sign in name

但是我没有使用任何社交帐户,仅使用本地帐户,使用您的社交帐户登录是空的。

我还尝试了这个示例,将 facebook 删除为社交帐户,只有本地帐户,但是它保留了空的Sign in with your social account

https://github.com/azure-ad-b2c/samples/tree/master/policies/embedded-password-reset

是否有人设法仅为本地帐户启用自助密码重置并具有正确的标题使用您的登录名登录

标签: azure-ad-b2cazure-ad-b2c-custom-policy

解决方案


有两种方法可以解决这个问题:

  1. 使用. Localization_ Identity Experience Framework这将允许您修改UxElements您的内容定义。可以在https://docs.microsoft.com/en-us/azure/active-directory-b2c/localization找到更多信息。
  2. 完全自定义用户界面 - https://docs.microsoft.com/en-us/azure/active-directory-b2c/customize-ui-with-html?pivots=b2c-custom-policy

我花了一分钟时间在我的一个策略上对此进行测试,但这是我添加到我的登录/注册页面以验证本地化的内容。

<BuildingBlocks>
   <Localization Enabled="true">
     <SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
       <SupportedLanguage>en</SupportedLanguage>
     </SupportedLanguages>
     <LocalizedResources Id="api.selfasserted.en">
       <LocalizedStrings>
         <LocalizedString ElementType="UxElement" StringId="local_intro_generic">Brad</LocalizedString>
       </LocalizedStrings>
     </LocalizedResources>
   </Localization>
</BuildingBlocks>

然后更新了我的内容定义:

<ContentDefinition Id="api.selfasserted">
  <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
  <RecoveryUri>~/common/default_page_error.html</RecoveryUri>
  <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.2</DataUri>
  <Metadata>
    <Item Key="DisplayName">Collect information from user page</Item>
  </Metadata>
  <LocalizedResourcesReferences>
    <LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.selfasserted.en"/>
  </LocalizedResourcesReferences>
</ContentDefinition>

推荐阅读