HttpJwtAuthorizerProps
- class aws_cdk.aws_apigatewayv2_authorizers.HttpJwtAuthorizerProps(*, jwt_audience, authorizer_name=None, identity_source=None)
Bases:
objectProperties to initialize HttpJwtAuthorizer.
- Parameters:
jwt_audience (
Sequence[str]) – 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]) – The name of the authorizer. Default: - same value asidpassed in the constructoridentity_source (
Optional[Sequence[str]]) – The identity source for which authorization is requested. Default: [‘$request.header.Authorization’]
- 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.example.com"), path="/books", authorizer=authorizer )
Attributes
- authorizer_name
The name of the authorizer.
- Default:
same value as
idpassed in the constructor
- identity_source
The identity source for which authorization is requested.
- Default:
[‘$request.header.Authorization’]
- jwt_audience
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.