@aws-cdk_aws-apigatewayv2-authorizers-alpha.HttpJwtAuthorizer

class HttpJwtAuthorizer ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Authorizers.Alpha.HttpJwtAuthorizer
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2authorizersalpha/v2#HttpJwtAuthorizer
Javasoftware.amazon.awscdk.services.apigatewayv2.authorizers.alpha.HttpJwtAuthorizer
Pythonaws_cdk.aws_apigatewayv2_authorizers_alpha.HttpJwtAuthorizer
TypeScript (source)@aws-cdk/aws-apigatewayv2-authorizers-alpha ยป HttpJwtAuthorizer

Implements IHttpRouteAuthorizer

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 HttpJwtAuthorizerProps โ€” Properties to configure the authorizer.

Initialize a JWT authorizer to be bound with HTTP route.

Methods

NameDescription
bind(options)๐Ÿ”นBind this authorizer to a specified Http route.

bind(options)๐Ÿ”น

public bind(options: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig

Parameters

  • options HttpRouteAuthorizerBindOptions

Returns

  • HttpRouteAuthorizerConfig

Bind this authorizer to a specified Http route.