| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/net/gaia/gaia_authenticator2.h" | 5 #include "chrome/common/net/gaia/gaia_authenticator2.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 "SID=%s&" | 39 "SID=%s&" |
| 40 "LSID=%s&" | 40 "LSID=%s&" |
| 41 "service=%s&" | 41 "service=%s&" |
| 42 "Session=true"; | 42 "Session=true"; |
| 43 | 43 |
| 44 // static | 44 // static |
| 45 const char GaiaAuthenticator2::kCookiePersistence[] = "true"; | 45 const char GaiaAuthenticator2::kCookiePersistence[] = "true"; |
| 46 // static | 46 // static |
| 47 const char GaiaAuthenticator2::kAccountType[] = "HOSTED_OR_GOOGLE"; | 47 const char GaiaAuthenticator2::kAccountType[] = "HOSTED_OR_GOOGLE"; |
| 48 // static | 48 // static |
| 49 const char GaiaAuthenticator2::kChromeOSSource[] = "chromeos"; | |
| 50 // static | |
| 51 // Service name for Gaia Contacts API. API is used to get user's image. | |
| 52 const char GaiaAuthenticator2::kContactsService[] = "cp"; | |
| 53 // static | |
| 54 const char GaiaAuthenticator2::kSecondFactor[] = "Info=InvalidSecondFactor"; | 49 const char GaiaAuthenticator2::kSecondFactor[] = "Info=InvalidSecondFactor"; |
| 55 | 50 |
| 56 // TODO(chron): These urls are also in auth_response_handler.h. | 51 // TODO(chron): These urls are also in auth_response_handler.h. |
| 57 // The URLs for different calls in the Google Accounts programmatic login API. | 52 // The URLs for different calls in the Google Accounts programmatic login API. |
| 58 const char GaiaAuthenticator2::kClientLoginUrl[] = | 53 const char GaiaAuthenticator2::kClientLoginUrl[] = |
| 59 "https://www.google.com/accounts/ClientLogin"; | 54 "https://www.google.com/accounts/ClientLogin"; |
| 60 const char GaiaAuthenticator2::kIssueAuthTokenUrl[] = | 55 const char GaiaAuthenticator2::kIssueAuthTokenUrl[] = |
| 61 "https://www.google.com/accounts/IssueAuthToken"; | 56 "https://www.google.com/accounts/IssueAuthToken"; |
| 62 | 57 |
| 63 GaiaAuthenticator2::GaiaAuthenticator2(GaiaAuthConsumer* consumer, | 58 GaiaAuthenticator2::GaiaAuthenticator2(GaiaAuthConsumer* consumer, |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 NOTREACHED(); | 278 NOTREACHED(); |
| 284 } | 279 } |
| 285 } | 280 } |
| 286 | 281 |
| 287 // static | 282 // static |
| 288 bool GaiaAuthenticator2::IsSecondFactorSuccess( | 283 bool GaiaAuthenticator2::IsSecondFactorSuccess( |
| 289 const std::string& alleged_error) { | 284 const std::string& alleged_error) { |
| 290 return alleged_error.find(kSecondFactor) != | 285 return alleged_error.find(kSecondFactor) != |
| 291 std::string::npos; | 286 std::string::npos; |
| 292 } | 287 } |
| OLD | NEW |