public static class CredentialFactoryA Google credential factory.
Namespace
Google.Apis.Auth.OAuth2Assembly
Google.Apis.Auth.dll
Methods
FromFile(string, string)
public static GoogleCredential FromFile(string credentialPath, string credentialType)Creates a credential of the specified type from a file that contains JSON credential data.
| Parameters | |
|---|---|
| Name | Description |
credentialPath |
stringThe path to the credential file. |
credentialType |
stringThe type of credential to be loaded. Valid strings can be found in JsonCredentialParameters. |
| Returns | |
|---|---|
| Type | Description |
GoogleCredential |
The created credential. |
FromFileAsync(string, string, CancellationToken)
public static Task<GoogleCredential> FromFileAsync(string credentialPath, string credentialType, CancellationToken cancellationToken)Creates a credential of the specified type from a file that contains JSON credential data.
| Parameters | |
|---|---|
| Name | Description |
credentialPath |
stringThe path to the credential file. |
credentialType |
stringThe type of credential to be loaded. Valid strings can be found in JsonCredentialParameters. |
cancellationToken |
CancellationTokenThe cancellation token to cancel the operation. |
| Returns | |
|---|---|
| Type | Description |
TaskGoogleCredential |
The created credential. |
FromFileAsync<T>(string, CancellationToken)
public static Task<T> FromFileAsync<T>(string credentialPath, CancellationToken cancellationToken)Creates a credential of the specified type from a file that contains JSON credential data.
| Parameters | |
|---|---|
| Name | Description |
credentialPath |
stringThe path to the credential file. |
cancellationToken |
CancellationTokenThe cancellation token to cancel the operation. |
| Returns | |
|---|---|
| Type | Description |
Task |
A task that will be completed with the created credential. |
| Type Parameter | |
|---|---|
| Name | Description |
T |
The type of the credential to create. |
FromFile<T>(string)
public static T FromFile<T>(string credentialPath)Creates a credential of the specified type from a file that contains JSON credential data.
| Parameter | |
|---|---|
| Name | Description |
credentialPath |
stringThe path to the credential file. |
| Returns | |
|---|---|
| Type | Description |
T |
The created credential. |
| Type Parameter | |
|---|---|
| Name | Description |
T |
The type of the credential to create. |
FromJson(string, string)
public static GoogleCredential FromJson(string json, string credentialType)Creates a credential of the specified type from a string that contains JSON credential data.
| Parameters | |
|---|---|
| Name | Description |
json |
stringThe string that contains the JSON credential data. |
credentialType |
stringThe type of credential to be loaded. Valid strings can be found in JsonCredentialParameters. |
| Returns | |
|---|---|
| Type | Description |
GoogleCredential |
The created credential. |
FromJson<T>(string)
public static T FromJson<T>(string json)Creates a credential of the specified type from a string that contains JSON credential data.
| Parameter | |
|---|---|
| Name | Description |
json |
stringThe string that contains the JSON credential data. |
| Returns | |
|---|---|
| Type | Description |
T |
The created credential. |
| Type Parameter | |
|---|---|
| Name | Description |
T |
The type of the credential to create. |
FromStreamAsync<T>(Stream, CancellationToken)
public static Task<T> FromStreamAsync<T>(Stream stream, CancellationToken cancellationToken)Creates a credential of the specified type from a stream that contains JSON credential data.
| Parameters | |
|---|---|
| Name | Description |
stream |
StreamThe stream that contains the JSON credential data. |
cancellationToken |
CancellationTokenThe cancellation token to cancel the operation. |
| Returns | |
|---|---|
| Type | Description |
Task |
A task that will be completed with the created credential. |
| Type Parameter | |
|---|---|
| Name | Description |
T |
The type of the credential to create. |
FromStream<T>(Stream)
public static T FromStream<T>(Stream stream)Creates a credential of the specified type from a stream that contains JSON credential data.
| Parameter | |
|---|---|
| Name | Description |
stream |
StreamThe stream that contains the JSON credential data. |
| Returns | |
|---|---|
| Type | Description |
T |
The created credential. |
| Type Parameter | |
|---|---|
| Name | Description |
T |
The type of the credential to create. |