Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(932)

Unified Diff: Src/GoogleApis.Auth/OAuth2/Web/AuthorizationCodeWebApp.cs

Issue 14341043: Issue 351: Reimplement OAuth2 (Step 4): ServiceAccount and MVC (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: Gus comments Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Src/GoogleApis.Auth/OAuth2/Web/AuthorizationCodeWebApp.cs
===================================================================
rename from Src/GoogleApis.Auth/OAuth2/AuthorizationCodeWebApp.cs
rename to Src/GoogleApis.Auth/OAuth2/Web/AuthorizationCodeWebApp.cs
--- a/Src/GoogleApis.Auth/OAuth2/AuthorizationCodeWebApp.cs
+++ b/Src/GoogleApis.Auth/OAuth2/Web/AuthorizationCodeWebApp.cs
@@ -18,9 +18,10 @@
using System.Threading;
using System.Threading.Tasks;
+using Google.Apis.Auth.OAuth2.Flows;
using Google.Apis.Auth.OAuth2.Requests;
-namespace Google.Apis.Auth.OAuth2
+namespace Google.Apis.Auth.OAuth2.Web
{
/// <summary>
/// Thread safe OAuth 2.0 authorization code flow for a web application that persists end-user credentials.
@@ -82,19 +83,19 @@
/// </summary>
public AuthorizationCodeWebApp(IAuthorizationCodeFlow flow, string redirectUri, string state)
{
- // TODO(peleyal): should we provide a way to disable to random number in the end of the state parameter?
+ // TODO(peleyal): Provide a way to disable to random number in the end of the state parameter.
this.flow = flow;
this.redirectUri = redirectUri;
this.state = state;
}
- /// <summary>Authorizes the web application to access user's protected data.</summary>
+ /// <summary>Asynchronously authorizes the web application to access user's protected data.</summary>
/// <param name="userId">User identifier</param>
/// <param name="taskCancellationToken">Cancellation token to cancel an operation</param>
/// <returns>
/// Auth result object which contains the user's credential or redirect URI for the authorization server
/// </returns>
- public async Task<AuthResult> Authorize(string userId, CancellationToken taskCancellationToken)
+ public async Task<AuthResult> AuthorizeAsync(string userId, CancellationToken taskCancellationToken)
{
// Try to load a token from the data store.
var token = await Flow.LoadTokenAsync(userId, taskCancellationToken).ConfigureAwait(false);
« no previous file with comments | « Src/GoogleApis.Auth/OAuth2/Web/AuthWebUtility.cs ('k') | Src/GoogleApis.DotNet4/Apis/Util/Store/FileDataStore.cs » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b