@aws-cdk_aws-apigatewayv2-authorizers-alpha.HttpJwtAuthorizer
class HttpJwtAuthorizer
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Apigatewayv2.Authorizers.Alpha.HttpJwtAuthorizer |
![]() | github.com/aws/aws-cdk-go/awscdkapigatewayv2authorizersalpha/v2#HttpJwtAuthorizer |
![]() | software.amazon.awscdk.services.apigatewayv2.authorizers.alpha.HttpJwtAuthorizer |
![]() | aws_cdk.aws_apigatewayv2_authorizers_alpha.HttpJwtAuthorizer |
![]() | @aws-cdk/aws-apigatewayv2-authorizers-alpha ยป 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-alpha';
import { HttpUrlIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';
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.example.com'),
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.