1.73.0 (latest) 1.69.0 1.68.0 1.60.0 1.59.0 1.55.0 1.50.0

    public class AuthorizationCodeInstalledApp : IAuthorizationCodeInstalledApp

Thread-safe OAuth 2.0 authorization code flow for an installed application that persists end-user credentials.

## Inheritance

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

## Implements

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

## 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.md.txt)

## Assembly

Google.Apis.Auth.dll

## Remarks

Incremental authorization (<https://developers.google.com/+/web/api/rest/oauth>) is currently not supported
for Installed Apps.

## Constructors

### AuthorizationCodeInstalledApp(IAuthorizationCodeFlow, ICodeReceiver)

    public AuthorizationCodeInstalledApp(IAuthorizationCodeFlow flow, ICodeReceiver codeReceiver)

Constructs a new authorization code installed application with the given flow and code receiver.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `flow` | `IAuthorizationCodeFlow` |
| `codeReceiver` | `ICodeReceiver` |

## Properties

### CodeReceiver

    public ICodeReceiver CodeReceiver { get; }

Gets the code receiver which is responsible for receiving the authorization code.

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

### Flow

    public IAuthorizationCodeFlow Flow { get; }

Gets the authorization code flow.

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

## Methods

### AuthorizeAsync(string, CancellationToken)

    public Task<UserCredential> AuthorizeAsync(string userId, CancellationToken taskCancellationToken)

Asynchronously authorizes the installed application to access user's protected data.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `userId` | `string` User identifier |
| `taskCancellationToken` | `CancellationToken` Cancellation token to cancel an operation |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskUserCredential` | The user's credential |

### ShouldRequestAuthorizationCode(TokenResponse)

    public bool ShouldRequestAuthorizationCode(TokenResponse token)

Determines the need for retrieval of a new authorization code, based on the given token and the
authorization code flow.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `token` | `TokenResponse` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

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