Hierarchy

  • SalesforceOAuth2

Constructors

Properties

authzServiceUrl: string
clientId: string
clientSecret: string
loginUrl: string
redirectUri: string
revokeServiceUrl: string
tokenServiceUrl: string
transport: Transport

Methods

  • Parameters

    • Optional params: {
          scope?: string;
          state?: string;
      }
      • Optional scope?: string
      • Optional state?: string

    Returns string

  • Introspect checks the current state of an OAuth 2.0 access or refresh token.

    Parameters

    • token: string

      Token strign to introspect

    • type: "refresh_token" | "access_token"

      Type of token to introspect

    Returns Promise<Record<string, any>>

  • Post a request to token service

    Type Parameters

    • T

    Parameters

    • params: Record<string, string>

      Params as object send as URL encoded data

    • Optional options: {
          url?: string;
      }
      • Optional url?: string

    Returns Promise<T>

    Response body as JSON object

  • Refreshes the oauth token and returns an OAuth2TokenResponse object.

    Parameters

    • refreshToken: string

      The refresh token used to get a new access token

    Returns Promise<OAuth2TokenResponse>

    New access token

  • Retrieves user information using the provided access token.

    Parameters

    • accessToken: string

      The access token to use for authentication.

    Returns Promise<Record<string, any>>

    A promise that resolves to an object containing user information.