@weareatlas/atlas-oidc-common
v0.0.1
Published
Contains types and helper functions to support authentication with the Atlas cloud platform.
Readme
Atlas Oidc Common
The Atlas OpenID Connect module contains types and helper functions to support authentication with the Atlas cloud platform.
This project is part of the Atlas UI development suite.
Installation
Install the package with
npm install @weareatlas/atlas-oidc-common --save
# or
yarn add @weareatlas/atlas-oidc-commonUsage
import {generateAuthorizationUrl, generateProofKey} from '@weareatlas/atlas-oidc-common';
// key to protect against interception attacks (https://tools.ietf.org/html/rfc7636)
const proofKey = generateProofKey();
// authorization url for client redirection
const url = generateAuthorizationUrl({
authorizationEndpoint: '<authorizationEndpoint>',
clientId: '<clientId>',
scopes: '<scopes>',
audience: '<audience>',
redirectUri: '<redirectUri>',
challenge: proofKey.challenge,
email: '<email>'
});