new Impersonated(options)
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.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
The configuration object. Properties
|
Methods
(async) fetchIdToken(targetAudience, options)
Generates an OpenID Connect ID token for a service account.
Parameters:
Name | Type | Description |
---|---|---|
targetAudience |
the audience for the fetched ID token. |
|
options |
the for the request |
Returns:
Type | Description |
---|---|
an OpenID Connect ID token |
getTargetPrincipal()
The service account email to be impersonated.
(async) refreshToken()
Refreshes the access token.
(async) sign(blobToSign)
Signs some bytes.
Parameters:
Name | Type | Description |
---|---|---|
blobToSign |
String to sign. |
Returns:
Type | Description |
---|---|
A SignBlobResponse denoting the keyID and signedBlob in base64 string |