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

Unified Diff: google_apis/gaia/gaia_auth_fetcher.h

Issue 1138143002: Pass Device ID in the oauth2/token request. Keep Device ID in local state on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment. Created 5 years, 7 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 | « components/user_manager/user_manager_base.cc ('k') | google_apis/gaia/gaia_auth_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c2c8f643fd2d38eca22bb55d29d818843c4ee33d..31ea47d214ece2f91e8e7816908a90a2bbc6991b 100644
--- a/google_apis/gaia/gaia_auth_fetcher.h
+++ b/google_apis/gaia/gaia_auth_fetcher.h
@@ -139,6 +139,17 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
// called on the consumer on the original thread.
void StartAuthCodeForOAuth2TokenExchange(const std::string& auth_code);
+ // Start a request to exchange the authorization code for an OAuthLogin-scoped
+ // oauth2 token.
+ // 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.
+ void StartAuthCodeForOAuth2TokenExchangeWithDeviceId(
+ const std::string& auth_code,
+ const std::string& device_id);
+
// Start a request to get user info for the account identified by |lsid|.
//
// Either OnGetUserInfoSuccess or OnGetUserInfoFailure will be
@@ -238,6 +249,8 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
static const char kClientLoginToOAuth2WithDeviceTypeBodyFormat[];
// The format of the POST body to get OAuth2 token pair from auth code.
static const char kOAuth2CodeToTokenPairBodyFormat[];
+ // Additional param for the POST body to get OAuth2 token pair from auth code.
+ static const char kOAuth2CodeToTokenPairDeviceIdParam[];
// The format of the POST body to revoke an OAuth2 token.
static const char kOAuth2RevokeTokenBodyFormat[];
// The format of the POST body for GetUserInfo.
@@ -379,8 +392,10 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
const char* const service);
// Create body to get OAuth2 auth code.
static std::string MakeGetAuthCodeBody(bool include_device_type);
- // Given auth code, create body to get OAuth2 token pair.
- static std::string MakeGetTokenPairBody(const std::string& auth_code);
+ // Given auth code and device ID (optional), create body to get OAuth2 token
+ // pair.
+ static std::string MakeGetTokenPairBody(const std::string& auth_code,
+ const std::string& device_id);
// Given an OAuth2 token, create body to revoke the token.
std::string MakeRevokeTokenBody(const std::string& auth_token);
// Supply the lsid returned from ClientLogin in order to fetch
« no previous file with comments | « components/user_manager/user_manager_base.cc ('k') | google_apis/gaia/gaia_auth_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698