You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure B2C自定义策略能否一次性合并3个以上输入声明?

Azure B2C自定义策略合并3个及以上输入声明生成完整地址

错误原因

你遇到的验证错误是因为Azure B2C内置的FormatStringMultipleClaims转换方法仅支持最多2个输入声明,因此添加第三个inputClaim3会触发输入声明不匹配的验证失败。

解决方案(无需多次两两合并)

使用FormatString转换方法,它支持在格式字符串中直接引用多个声明,实现一次性合并。示例代码如下:

<ClaimsTransformation Id="CreateFullAddress" TransformationMethod="FormatString">
  <InputParameters>
    <InputParameter Id="format" DataType="string" Value="{-Claim:number}, {-Claim:complement}, {-Claim:street}" />
  </InputParameters>
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="address" TransformationClaimType="outputClaim" />
  </OutputClaims>
</ClaimsTransformation>

说明

  • 该方法通过{-Claim:ClaimTypeReferenceId}语法直接在格式字符串中引用目标声明,支持任意数量的声明合并,只要格式字符串与引用的声明一一对应即可。
  • 确保所有被引用的声明(number、complement、street)已在策略中正确定义,且在执行该转换前已被填充有效值,避免合并后的地址出现空值占位。

内容的提问来源于stack exchange,提问作者Hansaka Sandaruwan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 11:20:05