0.0.1 • Published 4 years ago

@weareatlas/atlas-oidc-common v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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

Usage

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>'
            });