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