summaryrefslogtreecommitdiffstats
path: root/google_apis/gaia
diff options
context:
space:
mode:
authordzhioev <dzhioev@chromium.org>2015-08-11 12:31:41 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-11 19:32:21 +0000
commit54308302f2fe310fc34c14b01060d1561d3b5548 (patch)
tree1f343b7c8db823fdfab931501e68adaf33019605 /google_apis/gaia
parenta9cbe267748e0360f8c994a1c7209f86f33b944f (diff)
downloadchromium_src-54308302f2fe310fc34c14b01060d1561d3b5548.zip
chromium_src-54308302f2fe310fc34c14b01060d1561d3b5548.tar.gz
chromium_src-54308302f2fe310fc34c14b01060d1561d3b5548.tar.bz2
Pass "client_id" param to the enrollment frame.
A "client_id" param passed to GAIA should match a "client_id" that is used for token exchange afterwards, otherwise token exchange doesn't work. If the param is not specified, GAIA uses default value, which is the same as official Google Chrome's "client_id". We didn't provide "client_id" for enrollment frame, as a result enrollment only worked in official builds. BUG=495527 TEST=browser_tests Review URL: https://codereview.chromium.org/1282393002 Cr-Commit-Position: refs/heads/master@{#342871}
Diffstat (limited to 'google_apis/gaia')
-rw-r--r--google_apis/gaia/fake_gaia.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc
index d24158c..699c2c6 100644
--- a/google_apis/gaia/fake_gaia.cc
+++ b/google_apis/gaia/fake_gaia.cc
@@ -476,6 +476,15 @@ void FakeGaia::HandleServiceLogin(const HttpRequest& request,
void FakeGaia::HandleEmbeddedSetupChromeos(const HttpRequest& request,
BasicHttpResponse* http_response) {
+ GURL request_url = GURL("http://localhost").Resolve(request.relative_url);
+ std::string client_id;
+ if (!GetQueryParameter(request_url.query(), "client_id", &client_id) ||
+ GaiaUrls::GetInstance()->oauth2_chrome_client_id() != client_id) {
+ LOG(ERROR) << "Missing or invalid param 'client_id' in "
+ "/embedded/setup/chromeos call";
+ return;
+ }
+
http_response->set_code(net::HTTP_OK);
http_response->set_content(embedded_setup_chromeos_response_);
http_response->set_content_type("text/html");