azure - 如何在广告 B2C 自定义政策中添加类型 "StringCollection"的声明

标签 azure azure-active-directory azure-ad-b2c

我想添加两个“StringCollection”类型的输出声明, 1. 国家(例如:美国、英国等) 2.组(例如:XX、XY、XZ)

用户注册时需要保存这些数据,并且需要将这些数据添加到 token

我创建了以下声明类型:

<ClaimType Id="extension_countries">
        <DisplayName>Countries</DisplayName>
        <DataType>stringCollection</DataType>
        <UserHelpText>Country list</UserHelpText>
 </ClaimType>

和转换:

<ClaimsTransformation Id="CreateCountriesFromCountry" TransformationMethod="AddItemToStringCollection">
        <InputClaims>
          <InputClaim ClaimTypeReferenceId="country" TransformationClaimType="item" />
          <InputClaim ClaimTypeReferenceId="extension_countries" TransformationClaimType="collection" />
        </InputClaims>
        <OutputClaims>
          <OutputClaim ClaimTypeReferenceId="extension_countries" TransformationClaimType="collection" />
        </OutputClaims>
</ClaimsTransformation>

当我添加时 对于 RelyingParty 的“OutputClaims”,它显示错误 “技术配置文件中的扩展属性“extension_countries”不支持数据类型“StringCollection””

最佳答案

该错误可能是由于 AAD Graph API 扩展属性的潜在限制造成的:https://learn.microsoft.com/en-us/previous-versions/azure/ad/graph/howto/azure-ad-graph-api-directory-schema-extensions#extension-data-types--

可用类型:

  • 二进制
  • bool 值
  • 日期时间
  • 整数
  • 大整数
  • 字符串

因此您无法创建作为字符串集合的扩展属性。

关于azure - 如何在广告 B2C 自定义政策中添加类型 "StringCollection"的声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58613680/

相关文章:

Azure MSAL JS : How to edit profile?

azure - 可以在没有模拟器的情况下运行 Azure 缓存预览版吗?

authentication - 在 Asp.Net Core Web 应用中使用 EasyAuth 对 Azure 应用服务上的 AAD 进行身份验证时,无法填充 ClaimsPrincipal

azure - 如何将自定义 JavaScript 添加到 Azure AD B2C 登录流程

azure - Azure 服务主体访问多订阅 AD 帐户中的 App Insight 数据所需的权限

java - 使用 Azure java sdk 更新用户和组属性

Azure AD B2C - 异步电子邮件验证

Azure REST 服务成本

azure - 无法在 Azure Pipelines 中授权变量组

amazon-web-services - 适用于 Azure 虚拟机的 AWS CodeDeploy