Handles the creation of a web server for web based login flows.

Usage:

const oauthConfig = {
loginUrl: this.flags.instanceurl,
clientId: this.flags.clientid,
};

const oauthServer = await WebOAuthServer.create({ oauthConfig });
await oauthServer.start();
await open(oauthServer.getAuthorizationUrl(), { wait: false });
const authInfo = await oauthServer.authorizeAndSave();

Hierarchy

Constructors

Properties

DEFAULT_AUTH_TIMEOUT: number = 120_000
DEFAULT_PORT: number = 1717

Methods

  • Returns the authorization url that's used for the login flow

    Returns string

  • Returns the configured oauthLocalPort or the WebOAuthServer.DEFAULT_PORT

    Returns Promise<number>

  • Gets the authentication timeout from environment variable or returns default value

    Returns number

    • represents the auth timeout in ms