Options
All
  • Public
  • Public/Protected
  • All
Menu

Defines the root interface for all clients that generate credentials for calling Google APIs. All clients should implement this interface.

Hierarchy

  • CredentialsClient

Implemented by

Index

Properties

eagerRefreshThresholdMillis: number
forceRefreshOnFailure: boolean
projectId?: null | string

Methods

  • getAccessToken(): Promise<{ res?: null | GaxiosResponse<any>; token?: null | string }>
  • Returns Promise<{ res?: null | GaxiosResponse<any>; token?: null | string }>

    A promise that resolves with the current GCP access token response. If the current credential is expired, a new one is retrieved.

  • getRequestHeaders(url?: string): Promise<Headers>
  • The main authentication interface. It takes an optional url which when present is the endpoint being accessed, and returns a Promise which resolves with authorization header fields.

    The result has the form: { Authorization: 'Bearer ' }

    Parameters

    • Optional url: string

      The URI being authorized.

    Returns Promise<Headers>

  • Subscribes a listener to the tokens event triggered when a token is generated.

    Parameters

    • event: "tokens"

      The tokens event to subscribe to.

    • listener: (tokens: Credentials) => void

      The listener that triggers on event trigger.

    Returns CredentialsClient

    The current client instance.

  • Provides an alternative Gaxios request implementation with auth credentials

    Type parameters

    • T

    Parameters

    Returns GaxiosPromise<T>

  • Sets the auth credentials.

    Parameters

    Returns void