Class Compute (9.0.0)

Inheritance

AuthClient > OAuth2Client > Compute

Package

google-auth-library

Constructors

(constructor)(options)

constructor(options?: ComputeOptions);

Google Compute Engine service account credentials.

Retrieve access token from the metadata server. See: https://developers.google.com/compute/docs/authentication

Parameter
NameDescription
options ComputeOptions

Properties

scopes

scopes: string[];

Methods

fetchIdToken(targetAudience)

fetchIdToken(targetAudience: string): Promise<string>;

Fetches an ID token.

Parameter
NameDescription
targetAudience string

the audience for the fetched ID token.

Returns
TypeDescription
Promise<string>

refreshTokenNoCache(refreshToken)

protected refreshTokenNoCache(refreshToken?: string | null): Promise<GetTokenResponse>;

Refreshes the access token.

Parameter
NameDescription
refreshToken string | null

Unused parameter

Returns
TypeDescription
Promise<GetTokenResponse>

wrapError(e)

protected wrapError(e: GaxiosError): void;
Parameter
NameDescription
e GaxiosError
Returns
TypeDescription
void