public class Initializer : ServiceCredential.Initializer
An initializer class for the service account credential.
Namespace
Google.Apis.Auth.OAuth2Assembly
Google.Apis.Auth.dll
Constructors
Initializer(String)
public Initializer(string id)
Constructs a new initializer using the given id.
Parameter | |
---|---|
Name | Description |
id | String |
Initializer(String, String)
public Initializer(string id, string tokenServerUrl)
Constructs a new initializer using the given id and the token server URL.
Parameters | |
---|---|
Name | Description |
id | String |
tokenServerUrl | String |
Properties
Id
public string Id { get; }
Gets the service account ID (typically an e-mail address).
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
RsaKey |
KeyId
public string KeyId { get; set; }
Gets or sets the service account key ID.
Property Value | |
---|---|
Type | Description |
String |
ProjectId
public string ProjectId { get; set; }
The project ID associated with this credential.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
String |
Methods
FromCertificate(X509Certificate2)
public ServiceAccountCredential.Initializer FromCertificate(X509Certificate2 certificate)
Extracts a Key from the given certificate.
Parameter | |
---|---|
Name | Description |
certificate | X509Certificate2 |
Returns | |
---|---|
Type | Description |
ServiceAccountCredential.Initializer |
FromPrivateKey(String)
public ServiceAccountCredential.Initializer FromPrivateKey(string privateKey)
Extracts the Key from the given PKCS8 private key.
Parameter | |
---|---|
Name | Description |
privateKey | String |
Returns | |
---|---|
Type | Description |
ServiceAccountCredential.Initializer |