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

Unified Diff: google_apis/gaia/fake_gaia.cc

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: Comments addressed. 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
Index: google_apis/gaia/fake_gaia.cc
diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc
index bf2331d970abd5c8fcf42bd09cb9f1262ea6ff2d..7c9ff8c1d695b82d71466599861fc22c243d6f5d 100644
--- a/google_apis/gaia/fake_gaia.cc
+++ b/google_apis/gaia/fake_gaia.cc
@@ -602,6 +602,21 @@ void FakeGaia::HandleAuthToken(const HttpRequest& request,
return;
}
+ std::string device_id;
+ if (GetQueryParameter(request.content, "device_id", &device_id)) {
+ std::string device_type;
+ if (!GetQueryParameter(request.content, "device_type", &device_type)) {
+ http_response->set_code(net::HTTP_BAD_REQUEST);
+ LOG(ERROR) << "'device_type' should be set if 'device_id' is set.";
+ return;
+ }
+ if (device_type != "chrome") {
+ http_response->set_code(net::HTTP_BAD_REQUEST);
+ LOG(ERROR) << "'device_type' is not 'chrome'.";
+ return;
+ }
+ }
+
base::DictionaryValue response_dict;
response_dict.SetString("refresh_token",
merge_session_params_.refresh_token);

Powered by Google App Engine
This is Rietveld 408576698