Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kopertop/lambda-jwt
API Gateway Lambda function to support JSON Web Tokens
https://github.com/kopertop/lambda-jwt
Last synced: 3 months ago
JSON representation
API Gateway Lambda function to support JSON Web Tokens
- Host: GitHub
- URL: https://github.com/kopertop/lambda-jwt
- Owner: kopertop
- Created: 2016-02-12T14:42:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-08T13:21:29.000Z (almost 8 years ago)
- Last Synced: 2024-07-20T02:29:16.717Z (4 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 63
- Watchers: 6
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-functions - lambda-jwt - API Gateway Lambda function to support JSON Web Tokens. (AWS Lambda Functions)
README
Lambda API Gateway support for JSON Web Tokens
==============================================API Gateway custom Lambda function for JSON Web Token: https://jwt.io/introduction/
To Generate your own private key
--------------------------------
```
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -nodes
```Upload to AWS
-------------Log into the AWS console and create an empty "jwtAuthorize" function using Node.js.
Create or copy your public key as "cert.pem" in this folder.
Run
```
npm install
grunt deploy --account-id=
```Tie this function to your AWS API Gateway
-----------------------------------------Go to the AWS console and choose your API gateway. Under "Resources" choose "Custom Authorizers".
Create a new authorizer with the identityToken source of `method.request.header.Authorization`
and a Token validation expression of `Bearer [^\.]+\.[^\.]+\.[^\.]+` and associate it with your newly
created jwtAuthorizer Lambda function.