Google API Client Library for .NET  1.10.0
Static Public Member Functions | Static Public Attributes | List of all members
Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker Class Reference

A helper utility to manage the authorization code flow. More...

Static Public Member Functions

static async Task< UserCredentialAuthorizeAsync (ClientSecrets clientSecrets, IEnumerable< string > scopes, string user, CancellationToken taskCancellationToken, IDataStore dataStore=null)
 Asynchronously authorizes the specified user. More...
 
static async Task< UserCredentialAuthorizeAsync (Stream clientSecretsStream, IEnumerable< string > scopes, string user, CancellationToken taskCancellationToken, IDataStore dataStore=null)
 Asynchronously authorizes the specified user. More...
 
static async Task ReauthorizeAsync (UserCredential userCredential, CancellationToken taskCancellationToken)
 Asynchronously reauthorizes the user. This method should be called if the users want to authorize after they revoked the token. More...
 
static async Task< UserCredentialAuthorizeAsync (GoogleAuthorizationCodeFlow.Initializer initializer, IEnumerable< string > scopes, string user, CancellationToken taskCancellationToken, IDataStore dataStore=null)
 The core logic for asynchronously authorizing the specified user. More...
 
static async Task< UserCredentialAuthorizeAsync (Uri clientSecretsUri, IEnumerable< string > scopes, string user, CancellationToken taskCancellationToken)
 Asynchronously authorizes the specified user. More...
 
static async Task ReauthorizeAsync (UserCredential userCredential, CancellationToken taskCancellationToken)
 Asynchronously reauthorizes the user. This method should be called if the users want to authorize after they revoked the token. More...
 
static async Task< UserCredentialAuthorizeAsync (ClientSecrets clientSecrets, IEnumerable< string > scopes, string user, CancellationToken taskCancellationToken)
 Asynchronously authorizes the specified user. More...
 
static async Task< UserCredentialAuthorizeAsync (Stream clientSecretsStream, IEnumerable< string > scopes, string user, CancellationToken taskCancellationToken)
 Asynchronously authorizes the specified user. More...
 
static async Task ReauthorizeAsync (UserCredential userCredential, CancellationToken taskCancellationToken)
 Asynchronously reauthorizes the user. This method should be called if the users want to authorize after they revoked the token. More...
 
static async Task< UserCredentialAuthorizeAsync (Uri clientSecretsUri, IEnumerable< string > scopes, string user, CancellationToken taskCancellationToken)
 Asynchronously authorizes the specified user. More...
 
static async Task ReauthorizeAsync (UserCredential userCredential, CancellationToken taskCancellationToken)
 Asynchronously reauthorizes the user. This method should be called if the users want to authorize after they revoked the token. More...
 

Static Public Attributes

static string Folder = "Google.Apis.Auth"
 The folder which is used by the Google.Apis.Util.Store.FileDataStore. More...
 

Detailed Description

A helper utility to manage the authorization code flow.

Member Function Documentation

static async Task<UserCredential> Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync ( ClientSecrets  clientSecrets,
IEnumerable< string >  scopes,
string  user,
CancellationToken  taskCancellationToken 
)
inlinestatic

Asynchronously authorizes the specified user.

It uses Google.Apis.Util.Store.StorageDataStore as the flow's data store by default.

Parameters
clientSecretsThe client secrets.
scopesThe scopes which indicate the Google API access your application is requesting.
userThe user to authorize.
taskCancellationTokenCancellation token to cancel an operation.
Returns
User credential.
static async Task<UserCredential> Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync ( Uri  clientSecretsUri,
IEnumerable< string >  scopes,
string  user,
CancellationToken  taskCancellationToken 
)
inlinestatic

Asynchronously authorizes the specified user.

It uses Google.Apis.Util.Store.PasswordVaultDataStore as the flow's data store by default.

Parameters
clientSecretsUriThe client secrets URI.
scopesThe scopes which indicate the Google API access your application is requesting.
userThe user to authorize.
taskCancellationTokenCancellation token to cancel an operation.
Returns
User credential.
static async Task<UserCredential> Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync ( Uri  clientSecretsUri,
IEnumerable< string >  scopes,
string  user,
CancellationToken  taskCancellationToken 
)
inlinestatic

Asynchronously authorizes the specified user.

It uses Google.Apis.Util.Store.StorageDataStore as the flow's data store by default.

Parameters
clientSecretsUriThe client secrets URI.
scopesThe scopes which indicate the Google API access your application is requesting.
userThe user to authorize.
taskCancellationTokenCancellation token to cancel an operation.
Returns
User credential.
static async Task<UserCredential> Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync ( ClientSecrets  clientSecrets,
IEnumerable< string >  scopes,
string  user,
CancellationToken  taskCancellationToken,
IDataStore  dataStore = null 
)
inlinestatic

Asynchronously authorizes the specified user.

In case no data store is specified, Google.Apis.Util.Store.FileDataStore will be used by default.

Parameters
clientSecretsThe client secrets.
scopesThe scopes which indicate the Google API access your application is requesting.
userThe user to authorize.
taskCancellationTokenCancellation token to cancel an operation.
dataStoreThe data store, if not specified a file data store will be used.
Returns
User credential.
static async Task<UserCredential> Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync ( Stream  clientSecretsStream,
IEnumerable< string >  scopes,
string  user,
CancellationToken  taskCancellationToken 
)
inlinestatic

Asynchronously authorizes the specified user.

It uses Google.Apis.Util.Store.StorageDataStore as the flow's data store by default.

Parameters
clientSecretsStreamThe client secrets stream. The AuthorizationCodeFlow constructor is responsible for disposing the stream. Note that it's more secured to use the authenticate method which gets ClientSecrets, and hard code your secrets in your app rather than storing the secrets in a separate unsecured file.
scopesThe scopes which indicate the Google API access your application is requesting.
userThe user to authorize.
taskCancellationTokenCancellation token to cancel an operation.
Returns
User credential.
static async Task<UserCredential> Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync ( Stream  clientSecretsStream,
IEnumerable< string >  scopes,
string  user,
CancellationToken  taskCancellationToken,
IDataStore  dataStore = null 
)
inlinestatic

Asynchronously authorizes the specified user.

In case no data store is specified, Google.Apis.Util.Store.FileDataStore will be used by default.

Parameters
clientSecretsStreamThe client secrets stream. The authorization code flow constructor is responsible for disposing the stream.
scopesThe scopes which indicate the Google API access your application is requesting.
userThe user to authorize.
taskCancellationTokenCancellation token to cancel an operation.
dataStoreThe data store, if not specified a file data store will be used.
Returns
User credential.
static async Task<UserCredential> Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.AuthorizeAsync ( GoogleAuthorizationCodeFlow.Initializer  initializer,
IEnumerable< string >  scopes,
string  user,
CancellationToken  taskCancellationToken,
IDataStore  dataStore = null 
)
inlinestatic

The core logic for asynchronously authorizing the specified user.

Parameters
initializerThe authorization code initializer.
scopesThe scopes which indicate the Google API access your application is requesting.
userThe user to authorize.
taskCancellationTokenCancellation token to cancel an operation.
dataStoreThe data store, if not specified a file data store will be used.
Returns
User credential.
static async Task Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.ReauthorizeAsync ( UserCredential  userCredential,
CancellationToken  taskCancellationToken 
)
inlinestatic

Asynchronously reauthorizes the user. This method should be called if the users want to authorize after they revoked the token.

Parameters
userCredentialThe current user credential. Its UserCredential.Token will be updated.
taskCancellationTokenCancellation token to cancel an operation.
static async Task Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.ReauthorizeAsync ( UserCredential  userCredential,
CancellationToken  taskCancellationToken 
)
inlinestatic

Asynchronously reauthorizes the user. This method should be called if the users want to authorize after they revoked the token.

Parameters
userCredentialThe current user credential. Its UserCredential.Token will be updated.
taskCancellationTokenCancellation token to cancel an operation.
static async Task Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.ReauthorizeAsync ( UserCredential  userCredential,
CancellationToken  taskCancellationToken 
)
inlinestatic

Asynchronously reauthorizes the user. This method should be called if the users want to authorize after they revoked the token.

Parameters
userCredentialThe current user credential. Its UserCredential.Token will be updated.
taskCancellationTokenCancellation token to cancel an operation.
static async Task Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.ReauthorizeAsync ( UserCredential  userCredential,
CancellationToken  taskCancellationToken 
)
inlinestatic

Asynchronously reauthorizes the user. This method should be called if the users want to authorize after they revoked the token.

Parameters
userCredentialThe current user credential. Its UserCredential.Token will be updated.
taskCancellationTokenCancellation token to cancel an operation.

Member Data Documentation

string Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.Folder = "Google.Apis.Auth"
static

The folder which is used by the Google.Apis.Util.Store.FileDataStore.

The reason that this is not 'private const' is that a user can change it and store the credentials in a different location.


The documentation for this class was generated from the following file: