OAuth2 Client

The OAuth2Client module enables you to generate the URL required for accessing your authentication/authorization server. This is a re-export from the Javascript SDK.

Please read the Javascript SDK documentation for usage instructions.

import { OAuth2Config, OAuth2Client, Storage, FileStorage } from "@ssofy/node-sdk";
import fs from "fs";

const storagePath = fs.mkdtempSync('/tmp/');
const stateStore = new FileStorage(storagePath);

const config = new OAuth2Config({
    url: 'https://YOUR-SSO-DOMAIN',
    clientId: 'sandbox',
    clientSecret: 'sandbox',
    redirectUri: 'https://CURRENT-DOMAIN/callback'
    pkceVerification: true,
    scopes: ['*'],
    locale: 'en',
    stateStore: <Storage>stateStore,
    stateTtl: 30 * 24 * 60 * 60,

const client = new OAuth2Client(config);
ssofy Knowledge Base
At our core, we believe that staying up-to-date with the latest trends and advancements in Authentication and related areas is essential. That's why we take great pride in keeping you informed with the latest insights, updates, and news in this rapidly evolving landscape.

Do you need support?
SSOfy is by Cubelet Ltd.
Copyright © 2024 Cubelet Ltd. All rights reserved.