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

如何获取Azure AD B2C自定义策略声明转换方法完整支持列表?

Azure AD B2C Custom Policy: Valid Claim Transformation Methods

I feel your pain—tracking down the full list of supported claim transformation methods for Azure AD B2C custom policies is surprisingly tricky, especially since older documentation like the one you referenced is out of date (and yes, AddParameterToStringCollection is indeed deprecated, which is exactly why your policy fails to import).

Unfortunately, Microsoft doesn’t publish a comprehensive public list of all valid methods, but here’s how you can get the most accurate, up-to-date information, plus a curated list of commonly used current methods:

1. Extract Methods from Built-in Policies

The most reliable source is the TrustFrameworkBase.xml file exported from your Azure AD B2C tenant’s built-in policy. This file uses only currently supported transformations, so you can scan through its <ClaimsTransformations> section to see valid methods. Here are some of the most frequently used ones you’ll find there:

  • AddItemToStringCollection: Replaces the deprecated AddParameterToStringCollection—use this to add a parameter value to a string collection claim
  • AssertBooleanClaimIsEqualToValue: Validates that a boolean claim matches a specified value
  • CreateStringClaim: Generates a new string claim with a static value
  • GetSingleItemFromStringCollection: Retrieves the first item from a string collection claim
  • ModifyClaims: Updates existing claims with new values or conditions
  • RemoveItemFromStringCollection: Removes a specific item from a string collection claim
  • SetClaimIfEmpty: Sets a claim value only if it’s currently empty
  • StringReplace: Replaces substrings within a string claim
  • ConvertClaimToBoolean: Converts a claim value to a boolean type
  • ConvertClaimToDate: Parses a string claim into a date type
  • ConvertClaimToInteger: Converts a string claim to an integer type

2. Use Policy Import Error Messages

If you try to use an invalid or deprecated method, Azure AD B2C’s policy import error will often hint at valid alternatives. For example, when you tried AddParameterToStringCollection, the error message likely included a list of supported string collection transformations, pointing you directly to AddItemToStringCollection.

3. Reference Official Up-to-Date Samples

Microsoft’s official Azure AD B2C custom policy samples always use valid, current transformations. Check the claims transformation sections in these samples to see real-world usage of supported methods and confirm their syntax.

The key takeaway is that older methods like AddParameterToStringCollection have been replaced with more intuitive, consistent naming conventions. Always cross-reference with the latest built-in policies or official samples instead of relying on outdated documentation.

内容的提问来源于stack exchange,提问作者Ed Ilyin

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.15 06:54:05