src/lambda/handlers/lambda-authorizer.ts import { APIGatewayAuthorizerEvent, APIGatewayAuthorizerResult, } from 'aws-lambda'; import * as jwt from 'jsonwebtoken'; import * as util from 'util'; import * as jwks from 'jwks-rsa'; import ms from 'ms'; // event内のアクセストークンを取得 const getToken = (event: APIGatewayAuthorizerEvent) => { // event内のアクセストークンを取得 if (event.type !== 'TOKEN') { throw new Error(`even
![[後編] AWS CDKで API Gateway + Lambda 構成のREST APIを構築して Auth0 + Lambda Authorizerの認可機能を導入してみた | DevelopersIO](https://cdn-ak-scissors.b.st-hatena.com/image/square/43f916d5196c95657ed7fdc9da3617ebc49ca9af/height=288;version=1;width=512/https%3A%2F%2Fdevio2023-media.developers.io%2Fwp-content%2Fuploads%2F2021%2F12%2Feyecatch_auth0_1200x630.png)