2.0.0-prelease-3 • Published 1 year ago

happn-summon-auth-provider v2.0.0-prelease-3

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

happn-summon-auth-provider

Introduction

This module is an Authentication provider for Happn-3, which uses Safety-IO's Summon platform to authenticate users with Cognito and for use in Happn-3

Summon Configuration (tbd):

A product within Summon, for fieldpop services, will need to be created, as well as user roles which have access to that product.

Auth Provider Configuration:

In happn-3 configuration, the security service will need to be configured correctly in order to use this authentication provider, so for example,

const happnConfig = {
  secure: true,
  services: {
    security: {
      config: {
        authProviders:{
          happn3 :'./happn3-provider.js'
          summon: 'happn-summon-auth-provider',             
        }
        defaultAuthProvider: 'happn3' //One could also default to summon
    }
  }
};
  //server created with both standard happn3 and summon auth providers, happn3 default

In addition, the security config will need to be passed a summon config, which contains details about the summon host, as well as the local configuraiton. This defaults to :

const summonTestConfig = {
  host: 'http://localhost:4201', 
  login: '/api/auth/login',
  verify: '/api/auth/verifyToken',
  refresh: '/api/auth/refreshTokens',
  additionalHeaders: {
    app: 'SMC-client',
  },
  acceptedRoles: ["SMC-user", "SMC-OEM"] 
};

In practice, it is likely that the only variable that will need to be passed in will be the host, so, with the above, we would have

const happnConfig = {
  secure: true,
  services: {
    security: {
      config: {
        authProviders:{
          happn3 :'./happn3-provider.js'
          summon: 'happn-summon-auth-provider',             
        }
        defaultAuthProvider: 'happn3' //One could also default to summon
        summonConfig: {
            host: actualSummonHost.io:4201
        }
    }
  }
};
  //server created with both standard happn3 and summon auth providers, happn3 default, and connecting to a summon host running at actualSummonHost.io:4201