OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "google_apis/gaia/fake_gaia.h" | 5 #include "google_apis/gaia/fake_gaia.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 GetQueryParameter(request.content, "identifier", &email) && | 570 GetQueryParameter(request.content, "identifier", &email) && |
571 saml_account_idp_map_.find(email) != saml_account_idp_map_.end(); | 571 saml_account_idp_map_.find(email) != saml_account_idp_map_.end(); |
572 | 572 |
573 if (!is_saml) | 573 if (!is_saml) |
574 return; | 574 return; |
575 | 575 |
576 GURL url(saml_account_idp_map_[email]); | 576 GURL url(saml_account_idp_map_[email]); |
577 url = net::AppendQueryParameter(url, "SAMLRequest", "fake_request"); | 577 url = net::AppendQueryParameter(url, "SAMLRequest", "fake_request"); |
578 url = net::AppendQueryParameter( | 578 url = net::AppendQueryParameter( |
579 url, "RelayState", | 579 url, "RelayState", |
580 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/success.html"); | 580 GaiaUrls::GetInstance()->signin_completed_continue_url().spec()); |
581 std::string redirect_url = url.spec(); | 581 std::string redirect_url = url.spec(); |
582 http_response->AddCustomHeader("Google-Accounts-SAML", "Start"); | 582 http_response->AddCustomHeader("Google-Accounts-SAML", "Start"); |
583 | 583 |
584 http_response->AddCustomHeader("continue", redirect_url); | 584 http_response->AddCustomHeader("continue", redirect_url); |
585 } | 585 } |
586 | 586 |
587 void FakeGaia::HandleEmbeddedSigninChallenge(const HttpRequest& request, | 587 void FakeGaia::HandleEmbeddedSigninChallenge(const HttpRequest& request, |
588 BasicHttpResponse* http_response) { | 588 BasicHttpResponse* http_response) { |
589 std::string email; | 589 std::string email; |
590 GetQueryParameter(request.content, "identifier", &email); | 590 GetQueryParameter(request.content, "identifier", &email); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 if (token_info) { | 769 if (token_info) { |
770 base::DictionaryValue response_dict; | 770 base::DictionaryValue response_dict; |
771 response_dict.SetString("id", GetGaiaIdOfEmail(token_info->email)); | 771 response_dict.SetString("id", GetGaiaIdOfEmail(token_info->email)); |
772 response_dict.SetString("email", token_info->email); | 772 response_dict.SetString("email", token_info->email); |
773 response_dict.SetString("verified_email", token_info->email); | 773 response_dict.SetString("verified_email", token_info->email); |
774 FormatJSONResponse(response_dict, http_response); | 774 FormatJSONResponse(response_dict, http_response); |
775 } else { | 775 } else { |
776 http_response->set_code(net::HTTP_BAD_REQUEST); | 776 http_response->set_code(net::HTTP_BAD_REQUEST); |
777 } | 777 } |
778 } | 778 } |
OLD | NEW |