Skip to content

tiborhercz/lambda-jwt-authorizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Lambda JWT Authorizer

Lambda function written in Go for validating a JWT token signed with a KMS key. It uses the matelang/jwt-go-aws-kms library that provides an AWS KMS(Key Management Service) adapter to be used with the popular GoLang JWT library golang-jwt/jwt-go.

This Lambda can be used with AWS API Gateway as a Lambda authorizer for HTTP APIs. The Lambda function needs an environment variable KMS_JWT_KEY_ID for the KMS key ID used to sign the JWT token.

Build

To build the executable:

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build

CGO_ENABLED=0 is set for creating a stable binary package for standard C library (libc)