1.1.3 • Published 1 year ago

aws-user-authentication v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

AWS-Cognito JWT Authenticator

AWS-Cognito JWT authentication using express middleware.

Installation

Install my-project with npm

  npm install aws-user-authentication
  or
  yarn add aws-user-authentication

Features

  • AWS Cognito Authentication

  • Express middleware

    • Singleton pattern

Usage/Examples

const express = require('express');
const jwks = require('./jwks.json');
const auth = new (require('aws-user-authentication'))({
  jwks,
  isTokenBearer: true,
  clientId: '<CLIENT_ID>',
  tokenUse: 'access' || 'id',
  userPoolId: '<USER_POOL_ID>',
  key: '<AUTHENTICATION_KEY_IN_HEADER>',
});

const app = express();

const PORT = process.env.PORT || 3000;

app.get('/', new Authentication().validator, (req, res) => {
  console.log('Get request');
  return res.json('Hello World!');
});

app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});
1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago