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

Unified Diff: google_apis/gaia/gaia_auth_fetcher.cc

Issue 12704002: Support for auth code based authentication flow for both app and web UI driven flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase4 Created 7 years, 9 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
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/gaia_auth_fetcher.cc
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
index 822fc98ab9f7d3a5c86a9698e084e3f66a4b714f..40947687d9c26577eaed48b3c143ff7db1a46f0c 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -675,6 +675,22 @@ void GaiaAuthFetcher::StartCookieForOAuthLoginTokenExchange(
fetcher_->Start();
}
+void GaiaAuthFetcher::StartAuthCodeForOAuth2TokenExchange(
+ const std::string& auth_code) {
+ DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
+
+ DVLOG(1) << "Starting OAuth token pair fetch";
+ request_body_ = MakeGetTokenPairBody(auth_code);
+ fetcher_.reset(CreateGaiaFetcher(getter_,
+ request_body_,
+ "",
+ oauth2_token_gurl_,
+ kLoadFlagsIgnoreCookies,
+ this));
+ fetch_pending_ = true;
+ fetcher_->Start();
+}
+
void GaiaAuthFetcher::StartGetUserInfo(const std::string& lsid) {
DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
@@ -942,27 +958,12 @@ void GaiaAuthFetcher::OnClientLoginToOAuth2Fetched(
if (status.is_success() && response_code == net::HTTP_OK) {
std::string auth_code;
ParseClientLoginToOAuth2Response(cookies, &auth_code);
- StartOAuth2TokenPairFetch(auth_code);
+ StartAuthCodeForOAuth2TokenExchange(auth_code);
} else {
consumer_->OnClientOAuthFailure(GenerateAuthError(data, status));
}
}
-void GaiaAuthFetcher::StartOAuth2TokenPairFetch(const std::string& auth_code) {
- DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
-
- DVLOG(1) << "Starting OAuth token pair fetch";
- request_body_ = MakeGetTokenPairBody(auth_code);
- fetcher_.reset(CreateGaiaFetcher(getter_,
- request_body_,
- "",
- oauth2_token_gurl_,
- kLoadFlagsIgnoreCookies,
- this));
- fetch_pending_ = true;
- fetcher_->Start();
-}
-
void GaiaAuthFetcher::OnOAuth2TokenPairFetched(
const std::string& data,
const net::URLRequestStatus& status,
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698