@salte-auth/cognito

A Salte Auth provider for authenticating with Amazon's Cognito!


Keywords
salte-auth, oauth, 2.0, openid, cognito, authentication, provider
License
MIT
Install
npm install @salte-auth/cognito@3.0.10

Documentation

A Salte Auth provider for authenticating with Amazon's Cognito!

DocsDemo

NPM Version NPM Downloads CI Build Coveralls

semantic-release

Install

$ npm install @salte-auth/cognito

Usage

import { SalteAuth } from '@salte-auth/salte-auth';
import { Cognito } from '@salte-auth/cognito';
import { Redirect } from '@salte-auth/redirect';

/* 
 * Feel free to try out Salte Auth with this configuration!
 * 
 * It should work with the following domains:
 * - glitch.com
 * - localhost:8081
 */
const auth = new SalteAuth({
  providers: [
    new Cognito({
      responseType: 'token',
      url: 'https://salte-os.auth.us-east-1.amazoncognito.com',
      clientID: '5v4dilrda9p8cfo74gfvrc9hd4'
    })
  ],

  handlers: [
    new Redirect({
      default: true
    })
  ]
});

auth.login('cognito');