@stelligent/universal-google-sso
v1.0.0
Published
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:
Downloads
2
Keywords
Readme
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:
- Handles in-browser frontend authentication through Google
- 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