Loading
ただいま大変多くのお問い合わせをいただいており、ご連絡までにお時間を頂戴しております続きを読む

JWT Validation Policy: Custom Claim Validation DataWeave Expression Examples and Limitations

公開日: Aug 5, 2026
タスク

GOAL

Validate JWT tokens by checking that the scp claim contains at least one value from an allowed list (any-of-N scope validation) using the JWT Validation policy on Managed Omni Gateway.

ステップ

STEPS TO FOLLOW:


1. Apply the latest JWT Validation policy on a Managed Omni Gateway API instance.
2. Add a Custom Claim Validation row with an OR-style DataWeave expression, e.g.:
     Key: scp
     Value: #[(vars.claimSet.scp contains "scope-a") or (vars.claimSet.scp contains "scope-b")]
3. Click Apply — UI reports success.
4. Send a request with a JWT whose scp matches none of the allowed scopes.
5. Observe: HTTP 200 returned — the validation row was silently dropped.

 

NOTE: 

1.Map / reduce expressions: no error — policy applies but validation is silently skipped, unauthorized tokens return HTTP 200. If you need additional DataWeave function support (e.g. map/reduce, or other DW function extensions) for Flex Gateway policies, please upvote this feature enhancement request: Enhance DataWeave support for Flex Gateway policies

2.EXPRESSIONS THAT FAIL OR BEHAVE UNEXPECTEDLY:

#[(vars.claimSet.scp contains "a") or (vars.claimSet.scp contains "b")]
#[vars.claimSet.scp some (["a", "b"] contains $)]
#[vars.claimSet.scp map (["a", "b"] contains $) reduce ($$ or $)]
#[["a", "b"] contains vars.claimSet.scp[0] or ["a", "b"] contains vars.claimSet.scp[1]]

ナレッジ記事番号

005390575

 
読み込み中
Salesforce Help | Article