JSPM

@trinitiventures/hapi-cognito-auth

2.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q14548F
  • License MIT

A hapi plugin which adds Cognito authentication to your server

Package Exports

  • @trinitiventures/hapi-cognito-auth
  • @trinitiventures/hapi-cognito-auth/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@trinitiventures/hapi-cognito-auth) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hapi-cognito-auth

Continuous Integration License: MIT

This package adds a Cognito auth scheme to a hapi server

Installation

npm i @trinitiventures/hapi-cognito-auth

Configuration

Below is an example of how to configure this plugin with Confidence (pun intended ;)

module.exports = new Confidence.Store({
  server: {
    port: {
      $env: 'PORT',
      $coerce: 'number',
      $default: 3000
    },
  register: {
    plugins: [
      {
        plugin: '@trinitiventures/hapi-cognito-auth',
        options: {
          token: {
          aud: { $env: 'COGNITO_IDP_AUDIENCE' },
          iss: { $env: 'COGNITO_IDP_ISSUER' },
          use: 'id' //only accept idTokens
          },
          userPoolId: { $env: 'COGNITO_USER_POOL_ID' },
        }
      },
      {
        plugin: '../lib',
        options: {}
      }
    ]
  }
})

This project is licensed under the terms of the MIT license.