ServiceAccountCredentials constructor

ServiceAccountCredentials(
  1. String email,
  2. ClientId clientId,
  3. String privateKey, {
  4. String? impersonatedUser,
})

Creates a new ServiceAccountCredentials.

email is the e-mail address of the service account.

clientId is the client ID for the service account.

privateKey is the base 64 encoded, unencrypted private key, including the '-----BEGIN PRIVATE KEY-----' and '-----END PRIVATE KEY-----' boundaries.

The optional named argument impersonatedUser is used to set the user to impersonate if impersonating a user is needed.

Implementation

ServiceAccountCredentials(
  this.email,
  this.clientId,
  this.privateKey, {
  this.impersonatedUser,
}) : privateRSAKey = keyFromString(privateKey);