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

Unified Diff: google_apis/gaia/gaia_auth_fetcher.h

Issue 1644713002: Allow gaia auth fetcher to work with arbitrary clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: prevent unsafe usage Created 4 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 9c877b6eb78809e2d97eb262b7cb99c533722034..f833c6c643a42bdc13503bf98850e1f14463b7cf 100644
--- a/google_apis/gaia/gaia_auth_fetcher.h
+++ b/google_apis/gaia/gaia_auth_fetcher.h
@@ -98,12 +98,32 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
// Resulting refresh token is annotated on the server with |device_id|. Format
// of device_id on the server is at most 64 unicode characters.
//
- // Either OnClientOAuthSuccess or OnClientOAuthFailure will be
- // called on the consumer on the original thread.
+ // Either both OnClientOAuthCode and OnClientOAuthSuccess or
+ // OnClientOAuthFailure with optional OnClientOAuthCode will be called on the
+ // consumer on the original thread.
void StartCookieForOAuthLoginTokenExchangeWithDeviceId(
const std::string& session_index,
const std::string& device_id);
+ // Start a request to exchange the cookies of a signed-in user session
+ // and for specified client for an OAuthLogin-scoped oauth2 token. Client is
+ // determined by its |client_id|. In the case of a session with multiple
+ // accounts signed in, |session_index| indicate the which of accounts
+ // within the session. If |fetch_token_from_auth_code| is not set fetching
+ // process stops after receiving an auth code and ClientOAuthSuccess won't be
+ // called.
+ // Resulting refresh token is annotated on the server with |device_id|. Format
+ // of device_id on the server is at most 64 unicode characters.
+ //
+ // Either OnClientOAuthCode with optional ClientOAuthSuccess or
+ // OnClientOAuthFailure with optional OnClientOAuthCode will be called on the
+ // consumer on the original thread.
+ void StartCookieForOAuthLoginTokenExchangeWithClientIdAndDeviceId(
+ bool fetch_token_from_auth_code,
+ const std::string& session_index,
+ const std::string& client_id,
+ const std::string& device_id);
+
// Start a request to exchange the authorization code for an OAuthLogin-scoped
// oauth2 token.
//
@@ -433,6 +453,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
std::string request_body_;
std::string requested_service_;
bool fetch_pending_;
+ bool fetch_token_from_auth_code_;
// Headers used during the Logout call.
std::string logout_headers_;

Powered by Google App Engine
This is Rietveld 408576698