Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Unified Diff: google_apis/gaia/gaia_auth_fetcher.h

Issue 11649055: OAuth2 sign-in flow for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: google_apis/gaia/gaia_auth_fetcher.h
diff --git a/google_apis/gaia/gaia_auth_fetcher.h b/google_apis/gaia/gaia_auth_fetcher.h
index 2aea05bc425168cf68b761967775d9b8db50279a..f64161170e1f2244049f69dbee8f3980e814c178 100644
--- a/google_apis/gaia/gaia_auth_fetcher.h
+++ b/google_apis/gaia/gaia_auth_fetcher.h
@@ -69,13 +69,20 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
HostedAccountsSetting allow_hosted_accounts);
// Start a request to obtain service token for the the account identified by
- // |sid| and |lsid| and the service|service|.
+ // |sid| and |lsid| and the |service|.
//
// Either OnIssueAuthTokenSuccess or OnIssueAuthTokenFailure will be
// called on the consumer on the original thread.
void StartIssueAuthToken(const std::string& sid,
const std::string& lsid,
const char* const service);
+ // Start a request to obtain service token for the the account identified by
+ // |oauth2_access_token| and the |service|.
+ //
+ // Either OnIssueAuthTokenSuccess or OnIssueAuthTokenFailure will be
+ // called on the consumer on the original thread.
+ void StartIssueAuthTokenForOAuth2(const std::string& oauth2_access_token,
+ const char* const service);
// Start a request to exchange an "lso" service token given by |auth_token|
// for an OAuthLogin-scoped oauth2 token.
@@ -188,6 +195,8 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
static const char kClientLoginCaptchaFormat[];
// The format of the POST body for IssueAuthToken.
static const char kIssueAuthTokenFormat[];
+ // The format of the POST body for IssueAuthToken with OAuth2 access token.
+ static const char kIssueAuthTokenFormatForOAuth2[];
// The format of the POST body to get OAuth2 auth code from auth token.
static const char kClientLoginToOAuth2BodyFormat[];
// The format of the POST body to get OAuth2 token pair from auth code.
@@ -225,6 +234,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
// Constants for request/response for OAuth2 requests.
static const char kAuthHeaderFormat[];
static const char kOAuthHeaderFormat[];
+ static const char kOAuth2BearerHeaderFormat[];
static const char kClientLoginToOAuth2CookiePartSecure[];
static const char kClientLoginToOAuth2CookiePartHttpOnly[];
static const char kClientLoginToOAuth2CookiePartCodePrefix[];
@@ -309,6 +319,12 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
static std::string MakeIssueAuthTokenBody(const std::string& sid,
const std::string& lsid,
const char* const service);
+ // Request a long lived auth token for a service when authentication is based
+ // on OAuth2 access token.
+ static std::string MakeIssueAuthTokenBodyForOAuth2(const char* const service);
+ // Supply the OAuth2 access token in order to request a long lived
+ // auth token for a service.
+ static std::string StartIssueAuthTokenForOAuth2(const char* const service);
// Create body to get OAuth2 auth code.
static std::string MakeGetAuthCodeBody();
// Given auth code, create body to get OAuth2 token pair.

Powered by Google App Engine
This is Rietveld 408576698