Azure AD B2C 自定义策略中自定义声明的本地化

问题描述 投票:0回答:2

我的依赖方构建块部分有以下声明类型:

  <ClaimType Id="extension_mfaByPhoneOrEmail">
    <DisplayName>Please select your preferred MFA method</DisplayName>
    <DataType>string</DataType>
    <UserInputType>RadioSingleSelect</UserInputType>
    <Restriction>
      <Enumeration Text="Phone" Value="phone" SelectByDefault="true" />
      <!-- <Enumeration Text="Email " Value="email" SelectByDefault="false" /> -->
    </Restriction>
  </ClaimType>

我无法添加其他语言的本地化,我已经设置了 trustframeworklocalization.xml 文件,它适用于代码的其他部分。

azure-ad-b2c azure-ad-b2c-custom-policy
2个回答
0
投票

问题已部分解决,我在自断言内容定义 id 上添加了以下行:

<!-- Self Asserted localized strings (English) -->
<LocalizedResources Id="api.selfasserted.en">
<LocalizedStrings>
<LocalizedString ElementType="ClaimType" ElementId="extension_mfaByPhoneOrEmail" StringId="DisplayName">Please select your preferred MFA method</LocalizedString>
</LocalizedStrings>
</LocalizedResources>

0
投票

问题解决了,我在自断言内容定义 id 上添加了以下行:

  <LocalizedResources Id="api.selfasserted.en">
    <LocalizedCollections>
        <LocalizedCollection ElementType="ClaimType" ElementId="extension_mfaByPhoneOrEmail" TargetCollection="Restriction">
          <Item Text="Phone" Value="phone" />
          <Item Text="Email" Value="email" />
        </LocalizedCollection>
    </LocalizedCollections>  
    <LocalizedStrings>
      <LocalizedString ElementType="ClaimType" ElementId="extension_mfaByPhoneOrEmail" StringId="DisplayName">Please select your preferred MFA method</LocalizedString>
    </LocalizedStrings>
  </LocalizedResources>
© www.soinside.com 2019 - 2024. All rights reserved.