Class AuthorizationCodeInstalledApp (1.60.0)

public class AuthorizationCodeInstalledApp : IAuthorizationCodeInstalledApp

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

Inheritance

object > AuthorizationCodeInstalledApp

Namespace

GoogleApisAuthOAuth2

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
NameDescription
flowIAuthorizationCodeFlow
codeReceiverICodeReceiver

Properties

CodeReceiver

public ICodeReceiver CodeReceiver { get; }

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

Property Value
TypeDescription
ICodeReceiver

Flow

public IAuthorizationCodeFlow Flow { get; }

Gets the authorization code flow.

Property Value
TypeDescription
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
NameDescription
userIdstring

User identifier

taskCancellationTokenCancellationToken

Cancellation token to cancel an operation

Returns
TypeDescription
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
NameDescription
tokenTokenResponse
Returns
TypeDescription
bool

Extension Method