Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

APIGatewayProxyEventV2 authorizer Payload format does not have a nested jwt #113

@abbaspour

Description

@abbaspour

Documentation for API Gateway V2 request mentions that in the case of native JWT authorizer, claims are inside jwt object under event.requestContext.authorizer

However, what I see in practice is that authorizer information comes in as flat without jwt object.

Here is my authorizer:

resource "aws_apigatewayv2_authorizer" "auth0authorizer" {
  name             = "auth0authorizer"
  api_id           = aws_apigatewayv2_api.api.id
  authorizer_type  = "JWT"
  identity_sources = ["$request.header.Authorization"]

  jwt_configuration {
    audience = [var.api_audience]
    issuer   = "https://${var.auth0_domain}/"
  }
}

And here is the request object

{
  "requestContext": {
    "accountId": "377258293252",
    "apiId": "9kc4yptsm5",
    "authorizer": {
      "claims": {
        "aud": "some.api",
        "azp": "FT6TMjfHI2lkxjpAbG5tCjEdiEkyvMCA",
        "exp": "1612061676",
        "gty": "password",
        "iat": "1612053076",
        "iss": "https://tenant.auth0.com/",
        "scope": "get:data read:policies create:policy",
        "sub": "auth0|5fe435b5cbbc85006b071eba"
      },
      "scopes": null
    }
}

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