Class AuthorizationCodeInstalledApp
Thread-safe OAuth 2.0 authorization code flow for an installed application that persists end-user credentials.
Inheritance
System.Object
AuthorizationCodeInstalledApp
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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 |
---|---|---|
IAuthorizationCodeFlow | flow | |
ICodeReceiver | codeReceiver |
Properties
CodeReceiver
Gets the code receiver which is responsible for receiving the authorization code.
Declaration
public ICodeReceiver CodeReceiver { get; }
Property Value
Type | Description |
---|---|
ICodeReceiver |
Flow
Gets the authorization code flow.
Declaration
public IAuthorizationCodeFlow Flow { get; }
Property Value
Type | Description |
---|---|
IAuthorizationCodeFlow |
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 |
---|---|---|
System.String | userId | User identifier |
System.Threading.CancellationToken | taskCancellationToken | Cancellation token to cancel an operation |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserCredential> | 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 |
---|---|---|
TokenResponse | token |
Returns
Type | Description |
---|---|
System.Boolean |