HttpJwtAuthorizerProps

class aws_cdk.aws_apigatewayv2_authorizers.HttpJwtAuthorizerProps(*, jwt_audience, authorizer_name=None, identity_source=None)

Bases: object

(experimental) Properties to initialize HttpJwtAuthorizer.

Parameters:
  • jwt_audience (Sequence[str]) – (experimental) A list of the intended recipients of the JWT. A valid JWT must provide an aud that matches at least one entry in this list.

  • authorizer_name (Optional[str]) – (experimental) The name of the authorizer. Default: - same value as id passed in the constructor

  • identity_source (Optional[Sequence[str]]) – (experimental) The identity source for which authorization is requested. Default: [‘$request.header.Authorization’]

Stability:

experimental

ExampleMetadata:

infused

Example:

from aws_cdk.aws_apigatewayv2_authorizers import HttpJwtAuthorizer
from aws_cdk.aws_apigatewayv2_integrations import HttpUrlIntegration


issuer = "https://test.us.auth0.com"
authorizer = HttpJwtAuthorizer("BooksAuthorizer", issuer,
    jwt_audience=["3131231"]
)

api = apigwv2.HttpApi(self, "HttpApi")

api.add_routes(
    integration=HttpUrlIntegration("BooksIntegration", "https://get-books-proxy.myproxy.internal"),
    path="/books",
    authorizer=authorizer
)

Attributes

authorizer_name

(experimental) The name of the authorizer.

Default:
  • same value as id passed in the constructor

Stability:

experimental

identity_source

(experimental) The identity source for which authorization is requested.

Default:

[‘$request.header.Authorization’]

Stability:

experimental

jwt_audience

(experimental) A list of the intended recipients of the JWT.

A valid JWT must provide an aud that matches at least one entry in this list.

Stability:

experimental