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

AAD B2C已标记用户编排步骤未按预期跳过问题求助

解决AAD B2C编排步骤预条件无法跳过的问题

核心问题:Boolean值大小写不匹配

AAD B2C中,boolean类型声明(ClaimType)实际存储和传递的是小写的true/false,而你的预条件中使用了大写的True,导致ClaimEquals匹配失败,无法触发跳过步骤的动作。

修复步骤

1. 修改预条件中的值为小写

将两个编排步骤的预条件里的<Value>True</Value>改为<Value>true</Value>:

<!-- # The Tagging API Step -->
<OrchestrationStep Order="1" Type="ClaimsExchange">
  <Preconditions>
    <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
      <Value>extension_userTagged</Value>
      <Value>true</Value> <!-- 改为小写 -->
      <Action>SkipThisOrchestrationStep</Action>
    </Precondition>
  </Preconditions>
  <ClaimsExchanges>
    <ClaimsExchange Id="ApiTaggingStep" TechnicalProfileReferenceId="TPRestfulTagging" />
  </ClaimsExchanges>
</OrchestrationStep>

<!-- Setting the User Tagged to true -->
<OrchestrationStep Order="2" Type="ClaimsExchange">
  <Preconditions>
    <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
      <Value>extension_userTagged</Value>
      <Value>true</Value> <!-- 改为小写 -->
      <Action>SkipThisOrchestrationStep</Action>
    </Precondition>
  </Preconditions>
  <ClaimsExchanges>
    <ClaimsExchange Id="CheckUserIfTagged" TechnicalProfileReferenceId="UserTagged"/>
  </ClaimsExchanges>
</OrchestrationStep>

2. 确保在步骤1前读取用户的自定义属性

如果用户旅程中,编排步骤1之前没有从AAD B2C目录读取extension_userTagged属性,该claim的值可能不是用户的实际标记状态。需要在步骤1之前添加读取用户属性的编排步骤:

<OrchestrationStep Order="0" Type="ClaimsExchange">
  <ClaimsExchanges>
    <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
  </ClaimsExchanges>
</OrchestrationStep>

同时在AAD-UserReadUsingObjectId技术配置文件中添加该属性作为输出声明:

<TechnicalProfile Id="AAD-UserReadUsingObjectId">
  <!-- 其他配置保持不变 -->
  <OutputClaims>
    <!-- 已有输出声明 -->
    <OutputClaim ClaimTypeReferenceId="extension_userTagged" />
  </OutputClaims>
</TechnicalProfile>

3. 验证技术配置文件的boolean输出

你的UserTagged技术配置文件设置默认值为true,这里的大小写是正确的(AAD B2C会自动处理为boolean类型),AlwaysUseDefaultValue="true"的设置会强制覆盖已有claim值,但由于预条件的存在,已标记用户的该步骤会被跳过,不会覆盖值。

验证方法

修改配置后重新发布用户旅程,测试已标记用户的流程,查看日志确认extension_userTagged的值为小写true,且预条件触发跳过步骤1。

内容的提问来源于stack exchange,提问作者John Doe

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.30 00:25:01