Class Impersonated (8.6.0)

Inheritance

EventEmitter > AuthClient > OAuth2Client > Impersonated

Package

google-auth-library

Constructors

(constructor)(options)

constructor(options?: ImpersonatedOptions);

Impersonated service account credentials.

Create a new access token by impersonating another service account.

Impersonated Credentials allowing credentials issued to a user or service account to impersonate another. The source project using Impersonated Credentials must enable the "IAMCredentials" API. Also, the target service account must grant the orginating principal the "Service Account Token Creator" IAM role.

Parameter
NameDescription
options ImpersonatedOptions

The configuration object.

Methods

fetchIdToken(targetAudience, options)

fetchIdToken(targetAudience: string, options?: FetchIdTokenOptions): Promise<string>;

Generates an OpenID Connect ID token for a service account.

Parameters
NameDescription
targetAudience string

the audience for the fetched ID token.

options FetchIdTokenOptions

the for the request an OpenID Connect ID token

Returns
TypeDescription
Promise<string>

refreshToken(refreshToken)

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

Refreshes the access token.

Parameter
NameDescription
refreshToken string | null

Unused parameter

Returns
TypeDescription
Promise<GetTokenResponse>