# happn-summon-auth-provider

> Authentication Provider for use in happn, connecting to summon/AWS

Latest version **2.0.0-prelease-3** (published 2022-12-12) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install happn-summon-auth-provider
pnpm add happn-summon-auth-provider
yarn add happn-summon-auth-provider
bun add happn-summon-auth-provider
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0-prelease-3 |
| Published | 2022-12-12 |
| First published | 2022-12-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 63.9 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | J.Yspeert |
| Maintainers | simonbishopza |

## Links

- npm: https://www.npmjs.com/package/happn-summon-auth-provider
- Repository: https://github.com/FieldServer/happn-summon-auth-provider
- Homepage: https://github.com/FieldServer/happn-summon-auth-provider#readme
- Issues: https://github.com/FieldServer/happn-summon-auth-provider/issues
- npm.io page: https://npm.io/package/happn-summon-auth-provider

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Recent versions

- 2.0.0-prelease-3 (latest) — 2022-12-12
- 2.0.0-prerelease-4 (prerelease-2) — 2023-01-25

## README

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 configuered 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

```

---
_Source: https://npm.io/package/happn-summon-auth-provider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
