Class AuthorizationCodeInstalledApp
Thread-safe OAuth 2.0 authorization code flow for an installed application that persists end-user credentials.
Implements
Inherited Members
Namespace: Google.Apis.Auth.OAuth2
Assembly: Google.Apis.Auth.dll
Syntax
public class AuthorizationCodeInstalledApp : IAuthorizationCodeInstalledApp
Remarks
Incremental authorization (https://developers.google.com/+/web/api/rest/oauth) is currently not supported for Installed Apps.
Constructors
AuthorizationCodeInstalledApp(IAuthorizationCodeFlow, ICodeReceiver)
Constructs a new authorization code installed application with the given flow and code receiver.
Declaration
public AuthorizationCodeInstalledApp(IAuthorizationCodeFlow flow, ICodeReceiver codeReceiver)
Parameters
Type | Name | Description |
---|---|---|
IAuthorization |
flow | |
ICode |
codeReceiver |
Properties
CodeReceiver
Gets the code receiver which is responsible for receiving the authorization code.
Declaration
public ICodeReceiver CodeReceiver { get; }
Property Value
Type | Description |
---|---|
ICode |
Flow
Gets the authorization code flow.
Declaration
public IAuthorizationCodeFlow Flow { get; }
Property Value
Type | Description |
---|---|
IAuthorization |
Methods
AuthorizeAsync(string, CancellationToken)
Asynchronously authorizes the installed application to access user's protected data.
Declaration
public Task<UserCredential> AuthorizeAsync(string userId, CancellationToken taskCancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | userId | User identifier |
Cancellation |
taskCancellationToken | Cancellation token to cancel an operation |
Returns
Type | Description |
---|---|
Task<User |
The user's credential |
ShouldRequestAuthorizationCode(TokenResponse)
Determines the need for retrieval of a new authorization code, based on the given token and the authorization code flow.
Declaration
public bool ShouldRequestAuthorizationCode(TokenResponse token)
Parameters
Type | Name | Description |
---|---|---|
Token |
token |
Returns
Type | Description |
---|---|
bool |