module-ballerina-jwt icon indicating copy to clipboard operation
module-ballerina-jwt copied to clipboard

feat: add support for multiple sub claim validation

Open mathias-paris opened this issue 1 month ago • 2 comments
trafficstars

Purpose

Enable JWT validation against multiple sub claim values, using the same mechanism as the aud claim. This allows defining and validating against a list of acceptable sub values instead of a single one.

Examples

jwt:ValidatorConfig validatorConfig = {
    issuer: "wso2",
    username: [ "John" , "Sara" ],
    clockSkew: 60,
    signatureConfig: {
        certFile: "/path/to/public.crt"
    }
};

jwt:Payload result = check jwt:validate(jwt, validatorConfig);

Checklist

  • [ ] Linked to an issue
  • [ ] Updated the changelog
  • [x] Added tests
  • [ ] Updated the spec
  • [ ] Checked native-image compatibility

mathias-paris avatar Oct 02 '25 06:10 mathias-paris

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 02 '25 06:10 CLAassistant