Show / Hide Table of Contents

Class ServiceAccountCredential.Initializer

An initializer class for the service account credential.

Inheritance
System.Object
ServiceCredential.Initializer
ServiceAccountCredential.Initializer
Inherited Members
ServiceCredential.Initializer.TokenServerUrl
ServiceCredential.Initializer.Clock
ServiceCredential.Initializer.AccessMethod
ServiceCredential.Initializer.HttpClientFactory
ServiceCredential.Initializer.DefaultExponentialBackOffPolicy
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.Auth.OAuth2
Assembly: Google.Apis.Auth.dll
Syntax
public class Initializer : ServiceCredential.Initializer

Constructors

Initializer(String)

Constructs a new initializer using the given id.

Declaration
public Initializer(string id)
Parameters
Type Name Description
System.String id

Initializer(String, String)

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

Declaration
public Initializer(string id, string tokenServerUrl)
Parameters
Type Name Description
System.String id
System.String tokenServerUrl

Properties

Id

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

Declaration
public string Id { get; }
Property Value
Type Description
System.String

Key

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

Declaration
public RSA Key { get; set; }
Property Value
Type Description
System.Security.Cryptography.RSA

ProjectId

The project ID associated with this credential.

Declaration
public string ProjectId { get; set; }
Property Value
Type Description
System.String

Scopes

Gets the scopes which indicate API access your application is requesting.

Declaration
public IEnumerable<string> Scopes { get; set; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.String>

User

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

Declaration
public string User { get; set; }
Property Value
Type Description
System.String

Methods

FromCertificate(X509Certificate2)

Extracts a Key from the given certificate.

Declaration
public ServiceAccountCredential.Initializer FromCertificate(X509Certificate2 certificate)
Parameters
Type Name Description
System.Security.Cryptography.X509Certificates.X509Certificate2 certificate
Returns
Type Description
ServiceAccountCredential.Initializer

FromPrivateKey(String)

Extracts the Key from the given PKCS8 private key.

Declaration
public ServiceAccountCredential.Initializer FromPrivateKey(string privateKey)
Parameters
Type Name Description
System.String privateKey
Returns
Type Description
ServiceAccountCredential.Initializer
Back to top