# Class JsonCredentialParameters (1.73.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.73.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.JsonCredentialParameters)
- [1.69.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.69.0/Google.Apis.Auth.OAuth2.JsonCredentialParameters)
- [1.68.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.68.0/Google.Apis.Auth.OAuth2.JsonCredentialParameters)
- [1.60.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.60.0/Google.Apis.Auth.OAuth2.JsonCredentialParameters)
- [1.59.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.59.0/Google.Apis.Auth.OAuth2.JsonCredentialParameters)
- [1.55.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.55.0/Google.Apis.Auth.OAuth2.JsonCredentialParameters)
- [1.50.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/1.50.0/Google.Apis.Auth.OAuth2.JsonCredentialParameters)

    public class JsonCredentialParameters

Holder for credential parameters read from JSON credential file.
Fields are union of parameters for all supported credential types.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> JsonCredentialParameters

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Apis.Auth.OAuth2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2)

## Assembly

Google.Apis.Auth.dll

## Fields

### AuthorizedUserCredentialType

    public const string AuthorizedUserCredentialType = "authorized_user"

UserCredential is created by the GCloud SDK tool when the user runs
[GCloud Auth Login](https://cloud.google.com/sdk/gcloud/reference/auth/login).

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ExternalAccountAuthorizedUserCredentialType

    public const string ExternalAccountAuthorizedUserCredentialType = "external_account_authorized_user"

OAuth2 credentials sourced using external identities through Workforce Identity Federation.
Obtaining the initial access and refresh token can be done through the Google Cloud CLI.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ExternalAccountCredentialType

    public const string ExternalAccountCredentialType = "external_account"

See <https://cloud.google.com/iam/docs/workload-identity-federation> on how
to create external account credentials.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ImpersonatedServiceAccountCredentialType

    public const string ImpersonatedServiceAccountCredentialType = "impersonated_service_account"

ImpersonatedCredential is created by the GCloud SDK tool when the user runs
[GCloud Auth ADC Login](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login)
using the [--impersonate-service-account](https://cloud.google.com/sdk/gcloud/reference#--impersonate-service-account)
flag.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ServiceAccountCredentialType

    public const string ServiceAccountCredentialType = "service_account"

ServiceAccountCredential is downloaded by the user from
[Google Developers Console](https://console.developers.google.com).

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

## Properties

### Audience

    [JsonProperty("audience")]
    public string Audience { get; set; }

The STS audience associated with an external account credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ClientEmail

    [JsonProperty("client_email")]
    public string ClientEmail { get; set; }

Client Email associated with ServiceAccountCredential obtained from
[Google Developers Console](https://console.developers.google.com)

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ClientId

    [JsonProperty("client_id")]
    public string ClientId { get; set; }

Client Id associated with UserCredential created by
[GCloud Auth Login](https://cloud.google.com/sdk/gcloud/reference/auth/login)
or with an external account credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ClientSecret

    [JsonProperty("client_secret")]
    public string ClientSecret { get; set; }

Client Secret associated with UserCredential created by
[GCloud Auth Login](https://cloud.google.com/sdk/gcloud/reference/auth/login)
or with an external account credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### CredentialSourceConfig

    [JsonProperty("credential_source")]
    public JsonCredentialParameters.CredentialSource CredentialSourceConfig { get; set; }

The credential source associated with an external account credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.JsonCredentialParametershttps://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.JsonCredentialParameters.CredentialSource` |   |

### Delegates

    [JsonProperty("delegates")]
    public string[] Delegates { get; set; }

Delegates chain associated to the impersonated credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### PrivateKey

    [JsonProperty("private_key")]
    public string PrivateKey { get; set; }

Private Key associated with ServiceAccountCredential obtained from
[Google Developers Console](https://console.developers.google.com).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### PrivateKeyId

    [JsonProperty("private_key_id")]
    public string PrivateKeyId { get; set; }

Private Key ID associated with ServiceAccountCredential obtained from
[Google Developers Console](https://console.developers.google.com).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ProjectId

    [JsonProperty("project_id")]
    public string ProjectId { get; set; }

Project ID associated with this credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### QuotaProject

    [JsonProperty("quota_project_id")]
    public string QuotaProject { get; set; }

Project ID associated with this credential for the purposes
of quota calculations and billing.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### RefreshToken

    [JsonProperty("refresh_token")]
    public string RefreshToken { get; set; }

Refresh Token associated with UserCredential created by
[GCloud Auth Login](https://cloud.google.com/sdk/gcloud/reference/auth/login).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Scopes

    [JsonProperty("scopes")]
    public string[] Scopes { get; set; }

Scopes associated with the impersonated credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ServiceAccountImpersonationUrl

    [JsonProperty("service_account_impersonation_url")]
    public string ServiceAccountImpersonationUrl { get; set; }

This is the URL for the service account impersonation request
associated with a source credential or with an external account credential.
If this credential is an external account credential and this is not set,
the STS returned access token should be directly used without impersonation.
If this credential is not an external account credential and this is set,
then a credential source needs to be specified.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### SourceCredential

    [JsonProperty("source_credentials")]
    public JsonCredentialParameters SourceCredential { get; set; }

The source credential associated to the impersonated credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.JsonCredentialParameters` |   |

### SubjectTokenType

    [JsonProperty("subject_token_type")]
    public string SubjectTokenType { get; set; }

The STS subject token type associated with an external account credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### TokenInfoUrl

    [JsonProperty("token_info_url")]
    public string TokenInfoUrl { get; set; }

Endpoint to retrieve information related to an external account authorized user, like email, username, etc.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### TokenUri

    [JsonProperty("token_uri")]
    public string TokenUri { get; set; }

The token endpoint for a service account credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** Note that this is different from [TokenUrl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.JsonCredentialParameters#Google_Apis_Auth_OAuth2_JsonCredentialParameters_TokenUrl) which is the
STS token exchange endpoint associated with an external account credential.

### TokenUrl

    [JsonProperty("token_url")]
    public string TokenUrl { get; set; }

The STS token exchange endpoint associated with an external account credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** Note that this is different from [TokenUri](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.JsonCredentialParameters#Google_Apis_Auth_OAuth2_JsonCredentialParameters_TokenUri) which is the
the token endpoint for a service account credential.

### Type

    [JsonProperty("type")]
    public string Type { get; set; }

Type of the credential.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### UniverseDomain

    [JsonProperty("universe_domain")]
    public string UniverseDomain { get; set; }

Universe domain that this credential may be used in.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### WorkforcePoolUserProject

    [JsonProperty("workforce_pool_user_project")]
    public string WorkforcePoolUserProject { get; set; }

The GCP project number to be used for Workforce Pools
external credentials.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** If this external account credential represents a Workforce Pool
enabled identity and this values is not specified, then an API key needs to be
used alongside this credential to call Google APIs.

## Extension Method

[Utilities.ThrowIfNull\<T\>(T, string)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.Utilities#Google_Apis_Util_Utilities_ThrowIfNull__1___0_System_String_)