Class ServiceAccountCredential.Initializer (1.59.0)

public class Initializer : ServiceCredential.Initializer

An initializer class for the service account credential.

Inheritance

Object > ServiceCredential.Initializer > ServiceAccountCredential.Initializer

Namespace

Google.Apis.Auth.OAuth2

Assembly

Google.Apis.Auth.dll

Constructors

Initializer(String)

public Initializer(string id)

Constructs a new initializer using the given id.

Parameter
NameDescription
idString

Initializer(String, String)

public Initializer(string id, string tokenServerUrl)

Constructs a new initializer using the given id and the token server URL.

Parameters
NameDescription
idString
tokenServerUrlString

Properties

Id

public string Id { get; }

Gets the service account ID (typically an e-mail address).

Property Value
TypeDescription
String

Key

public RsaKey Key { get; set; }

Gets or sets the key which is used to sign the request, as specified in https://developers.google.com/accounts/docs/OAuth2ServiceAccount#computingsignature.

Property Value
TypeDescription
RsaKey

KeyId

public string KeyId { get; set; }

Gets or sets the service account key ID.

Property Value
TypeDescription
String

ProjectId

public string ProjectId { get; set; }

The project ID associated with this credential.

Property Value
TypeDescription
String

UseJwtAccessWithScopes

public bool UseJwtAccessWithScopes { get; set; }

Gets or sets the flag preferring use of self-signed JWTs over OAuth tokens when OAuth scopes are explicitly set.

Property Value
TypeDescription
Boolean

User

public string User { get; set; }

Gets or sets the email address of the user the application is trying to impersonate in the service account flow or null.

Property Value
TypeDescription
String

Methods

FromCertificate(X509Certificate2)

public ServiceAccountCredential.Initializer FromCertificate(X509Certificate2 certificate)

Extracts a Key from the given certificate.

Parameter
NameDescription
certificateX509Certificate2
Returns
TypeDescription
ServiceAccountCredential.Initializer

FromPrivateKey(String)

public ServiceAccountCredential.Initializer FromPrivateKey(string privateKey)

Extracts the Key from the given PKCS8 private key.

Parameter
NameDescription
privateKeyString
Returns
TypeDescription
ServiceAccountCredential.Initializer

Extension Method