@stelligent/universal-google-sso

1.0.0 • Public • Published

Stelligent Universal Google SSO

This repository houses the source code for Stelligent's universal Google login workflow for the frontend of all our internal tools. It accomplishes two things:

  1. Handles in-browser frontend authentication through Google
  2. Deploys a tiny lambda that works with the frontend to return binary API keys

The goal is to have internal backends at Stelligent to work with binary API keys and avoid including Google auth logic in every single backend.

The project is a react component.

Getting Started (backend)

in your environment, define:

export BACKEND_APIKEY_SSM_PATH=<path to SSM String that contains the key>

in your terminal, execute:

npm run cdk deploy

Getting Started (frontend)

in your terminal, execute:

npm i --save @stelligent/universal-google-sso

in your environment, define:

export REACT_APP_GOOGLE_CLIENT_ID=<your Google project client ID>.apps.googleusercontent.com
export REACT_APP_LOGIN_LAMBDA_URL=<https URL of the API Gateway front of the lambda>

in your React frontend:

import React from 'react';
import StelligentLogin from '@stelligent/universal-google-sso'

export class MyCustomComponent extends React.Component {
  gotApiKey = key => {
    if (key) console.log(`Backend API key: ${key}`);
    else console.error('There was an error authenticating');
  }
  render() {
    return (<StelligentLogin onApiKey=${this.gotApiKey}>)
  }
}

Publishing to NPM

make sure you are authenticated to NPM, then execute:

npm publish --access=public

Readme

Keywords

none

Package Sidebar

Install

npm i @stelligent/universal-google-sso

Weekly Downloads

1

Version

1.0.0

License

none

Unpacked Size

16.1 kB

Total Files

6

Last publish

Collaborators

  • jtulick
  • mneil
  • sepehr-laal
  • oshaughnessy