OAuth2 class

Constructors

Properties

_transport: Transport
authzServiceUrl: string
clientId: Optional<string>
clientSecret: Optional<string>
codeVerifier: Optional<string>
loginUrl: string
redirectUri: Optional<string>
revokeServiceUrl: string
tokenServiceUrl: string

Methods

  • OAuth2 Username-Password Flow (Resource Owner Password Credentials)

    Parameters

    • username: string
    • password: string

    Returns Promise<TokenResponse>

  • Get Salesforce OAuth2 authorization page URL to redirect user agent.

    Parameters

    Returns string

  • Send access token request to the token endpoint. When a code (string) is passed in first argument, it will use Web Server Authentication Flow (Authorization Code Grant). Otherwise, it will use the specified grant_type and pass parameters to the endpoint.

    Parameters

    • codeOrParams: string | {
          grant_type: string;
          [name: string]: string;
      }
    • params: {
          [prop: string]: string;
      } = {}
      • [prop: string]: string

    Returns Promise<TokenResponse>

  • OAuth2 Revoke Session Token

    Parameters

    • token: string

    Returns Promise<void>