Class ServiceAccountCredential.Initializer
An initializer class for the service account credential.
Inherited Members
Namespace: Google.Apis.Auth.OAuth2
Assembly: Google.Apis.Auth.dll
Syntax
public class ServiceAccountCredential.Initializer : ServiceCredential.Initializer
Constructors
Initializer(string)
Constructs a new initializer using the given id.
Declaration
public Initializer(string id)
Parameters
Type | Name | Description |
---|---|---|
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
Properties
Id
Gets the service account ID (typically an e-mail address).
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
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 |
---|---|
RSA |
KeyId
Gets or sets the service account key ID.
Declaration
public string KeyId { get; set; }
Property Value
Type | Description |
---|---|
string |
ProjectId
The project ID associated with this credential.
Declaration
public string ProjectId { get; set; }
Property Value
Type | Description |
---|---|
string |
UniverseDomain
The universe domain this credential belongs to. Won't be null.
Declaration
public string UniverseDomain { get; set; }
Property Value
Type | Description |
---|---|
string |
UseJwtAccessWithScopes
Gets or sets the flag preferring use of self-signed JWTs over OAuth tokens when OAuth scopes are explicitly set.
Declaration
public bool UseJwtAccessWithScopes { get; set; }
Property Value
Type | Description |
---|---|
bool |
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 |
---|---|
string |
Methods
FromCertificate(X509Certificate2)
Extracts a Key from the given certificate.
Declaration
public ServiceAccountCredential.Initializer FromCertificate(X509Certificate2 certificate)
Parameters
Type | Name | Description |
---|---|---|
X509Certificate2 | certificate |
Returns
Type | Description |
---|---|
Service |
FromPrivateKey(string)
Extracts the Key from the given PKCS8 private key.
Declaration
public ServiceAccountCredential.Initializer FromPrivateKey(string privateKey)
Parameters
Type | Name | Description |
---|---|---|
string | privateKey |
Returns
Type | Description |
---|---|
Service |