public class AuthorizationCodeInstalledApp : IAuthorizationCodeInstalledApp
Thread-safe OAuth 2.0 authorization code flow for an installed application that persists end-user credentials.
Implements
IAuthorizationCodeInstalledAppNamespace
GoogleApisAuthOAuth2Assembly
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.
Name | Description |
flow | IAuthorizationCodeFlow |
codeReceiver | ICodeReceiver |
Properties
CodeReceiver
public ICodeReceiver CodeReceiver { get; }
Gets the code receiver which is responsible for receiving the authorization code.
Type | Description |
ICodeReceiver |
Flow
public IAuthorizationCodeFlow Flow { get; }
Gets the authorization code flow.
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.
Name | Description |
userId | string User identifier |
taskCancellationToken | CancellationToken Cancellation token to cancel an operation |
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.
Name | Description |
token | TokenResponse |
Type | Description |
bool |