Skip to content

aud claim can be an array #16

@corbs9

Description

@corbs9

Proposal

It seems that when trying to provide an array of claims, the extensions fails due to it checking whether the value is either a String, Integer, or Long. According to RFC 7519, the aud in general is an array of StringOrURI but in under a special case can it be a single string.

The issue is here where it checks the reserved list of claims and fails when the value provided is an Array.

Would you mind if I raise a PR to address this issue?

Reproduction steps

  • Create response mapping:
{
  "request": {
    "method": "POST",
    "urlPath": "/test/idp/login"
  },
  "response": {
    "status": 200,
    "headers": {
      "Content-Type": "application/json"
    },
    "transformers": [
      "response-template"
    ],
    "jsonBody": {
      "accessToken": "{{{jwt sub='[email protected]' aud=(claims 'some_audience') reference=af961c9a-365e-4c76-b98a-352e140e51d8 }}}"
    }
  }
}
  • Call the endpoint:
curl -X POST  "http://localhost:8081/test/idp/login"
  • Returns an error
    1:3: java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap')%

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions