Skip to content

HTTP API JWT authorizer rejects array aud and matches client_id when aud is present #7652

Open

Description

@rafaelpadilla

Problem

The HTTP API (v2) JWT authorizer validates aud differently from API Gateway on AWS in two ways.

1. An array aud is always rejected. parseJwtClaims reads the claim with claims.path("aud").asText(null). For a JSON array, Jackson's asText() returns "", so the audience check compares the configured audience with an empty string and fails. An array aud is valid per RFC 7519 §4.1.3, and API Gateway accepts the token when any entry matches the authorizer's audience list.

Auth0 issues this shape whenever the openid scope is requested, for example ["https://api.example.com", "https://<tenant>.auth0.com/userinfo"]. So an Auth0-backed JWT authorizer can't authenticate any user-login token on Floci, while AWS accepts the same token.

2. client_id is matched even when aud is present. A token with aud: ["other"] and client_id: "expected" passes an authorizer configured with audience ["expected"]. The AWS docs say API Gateway checks client_id only when aud is absent; when both are present, it evaluates aud.

Repro (array aud)

  1. Create an HTTP API with a JWT authorizer: issuer = https://<tenant>.auth0.com/, audience = ["https://api.example.com"].
  2. Log in through Auth0 with scope=openid ...&audience=https://api.example.com.
  3. Call a JWT-protected route with Authorization: Bearer <access token>. Floci returns 401 {"message":"Unauthorized"}.

Scope

  • Parse aud as either a string or an array, and match when any configured audience is among its entries.
  • Fall back to client_id (Cognito access tokens) only when the token has no aud claim. An aud that is present but empty or has no matching entry is rejected.
  • No change to signature, exp, iss or scope checks, or to their order.

Activity

  1. github-actions commented on Nov 6, 2026

    @github-actions

    👋 Thanks for opening your first issue in Floci!

    A maintainer will triage this and add the right service label. If you included a minimal reproduction and the Floci version, that is everything we need — no action required from you right now.

    Come say hi in Slack if you want to talk it through with maintainers and other contributors. Questions about AWS behaviour, design tradeoffs, and rough proposals are all welcome there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions