Class ClientCredentials

An Authenticator class for the OAuth 2.0 Client Credentials grant.

Hierarchy

Constructors

Properties

_accessToken?: string
_authInProgress: boolean = true
_expires?: number
authServer: string = DEFAULT_AUTH_SERVER
baseUrl: string = DEFAULT_BASE_URL
clientId: string
clientSecret: string

Accessors

  • get accessToken(): Promise<undefined | string>
  • Promise that will resolve with an access token if available or undefined otherwise. This will try to fetch a new access token if:

    • the class implements the fetchAccessToken method
    • no unexpired access token is stored in this class

    Returns Promise<undefined | string>

Methods

  • This method fetches an access token using the OAuth 2.0 Client Credentials grant and returns it

    Returns Promise<{
        accessToken: string;
        expiresIn: number;
    }>

Generated using TypeDoc