class HttpJwtAuthorizer
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGatewayv2.Authorizers.HttpJwtAuthorizer |
![]() | software.amazon.awscdk.services.apigatewayv2.authorizers.HttpJwtAuthorizer |
![]() | aws_cdk.aws_apigatewayv2_authorizers.HttpJwtAuthorizer |
![]() | @aws-cdk/aws-apigatewayv2-authorizers » HttpJwtAuthorizer |
Implements
IHttp
Authorize Http Api routes on whether the requester is registered as part of an AWS Cognito user pool.
Example
import { HttpJwtAuthorizer } from '@aws-cdk/aws-apigatewayv2-authorizers';
import { HttpUrlIntegration } from '@aws-cdk/aws-apigatewayv2-integrations';
const issuer = 'https://test.us.auth0.com';
const authorizer = new HttpJwtAuthorizer('BooksAuthorizer', issuer, {
jwtAudience: ['3131231'],
});
const api = new apigwv2.HttpApi(this, 'HttpApi');
api.addRoutes({
integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.myproxy.internal'),
path: '/books',
authorizer,
});
Initializer
new HttpJwtAuthorizer(id: string, jwtIssuer: string, props: HttpJwtAuthorizerProps)
Parameters
- id
string
— The id of the underlying construct. - jwtIssuer
string
— The base domain of the identity provider that issues JWT. - props
Http
— Properties to configure the authorizer.Jwt Authorizer Props
Initialize a JWT authorizer to be bound with HTTP route.
Methods
Name | Description |
---|---|
bind(options) | Bind this authorizer to a specified Http route. |
bind(options)
public bind(options: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig
Parameters
- options
Http
Route Authorizer Bind Options
Returns
Bind this authorizer to a specified Http route.