1.73.0 (latest) 1.69.0 1.68.0 1.60.0 1.59.0 1.55.0 1.50.0

    public class AuthorizationCodeFlow.Initializer

An initializer class for the authorization code flow.

## Inheritance

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

## 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)

## Derived Types

[GoogleAuthorizationCodeFlow.Initializer](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.Flows.GoogleAuthorizationCodeFlow.Initializer.md.txt)

## Namespace

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

## Assembly

Google.Apis.Auth.dll

## Constructors

### Initializer(string, string)

    public Initializer(string authorizationServerUrl, string tokenServerUrl)

Constructs a new initializer.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `authorizationServerUrl` | `string` Authorization server URL |
| `tokenServerUrl` | `string` Token server URL |

## Properties

### AccessMethod

    public IAccessMethod AccessMethod { get; set; }

Gets or sets the method for presenting the access token to the resource server.
The default value is
[BearerToken.AuthorizationHeaderAccessMethod](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.BearerToken.AuthorizationHeaderAccessMethod.md.txt).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `IAccessMethod` |   |

### AuthorizationServerUrl

    public string AuthorizationServerUrl { get; }

Gets or sets the authorization server URL.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### ClientSecrets

    public ClientSecrets ClientSecrets { get; set; }

Gets or sets the client secrets which includes the client identifier and its secret.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `ClientSecrets` |   |

### ClientSecretsStream

    public Stream ClientSecretsStream { get; set; }

Gets or sets the client secrets stream which contains the client identifier and its secret.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `Stream` |   |

**Remarks** The AuthorizationCodeFlow constructor is responsible for disposing the stream.

### Clock

    public IClock Clock { get; set; }

Gets or sets the clock. The clock is used to determine if the token has expired, if so we will try to
refresh it. The default value is [Default](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.SystemClock.md.txt#Google_Apis_Util_SystemClock_Default).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `IClock` |   |

### DataStore

    public IDataStore DataStore { get; set; }

Gets or sets the data store used to store the token response.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `IDataStore` |   |

### DefaultExponentialBackOffPolicy

    public ExponentialBackOffPolicy DefaultExponentialBackOffPolicy { get; set; }

Indicates which of exceptions and / or HTTP status codes are automatically retried using exponential backoff.
The default value is [RecommendedOrDefault](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ExponentialBackOffPolicy.md.txt#Google_Apis_Http_ExponentialBackOffPolicy_RecommendedOrDefault) which means retries will be
executed as recommended by each service. For services that have no specific recommendations
[UnsuccessfulResponse503](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ExponentialBackOffPolicy.md.txt#Google_Apis_Http_ExponentialBackOffPolicy_UnsuccessfulResponse503) will be used, which means HTTP Status code 503
will be retried with exponential backoff.
If set to [None](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.ExponentialBackOffPolicy.md.txt#Google_Apis_Http_ExponentialBackOffPolicy_None) no automatic retries will happen.
Calling code may still specify custom retries by configuring [HttpClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.md.txt#Google_Apis_Auth_OAuth2_Flows_AuthorizationCodeFlow_HttpClient).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `ExponentialBackOffPolicy` |   |

### HttpClientFactory

    public IHttpClientFactory HttpClientFactory { get; set; }

Gets or sets the factory for creating [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient) instance.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `IHttpClientFactory` |   |

### Scopes

    public IEnumerable<string> Scopes { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `IEnumerablestring` |   |

### TokenServerUrl

    public string TokenServerUrl { get; }

Gets the token server URL.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

## Extension Method

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