Index: chrome/common/net/gaia/gaia_urls.cc |
diff --git a/chrome/common/net/gaia/gaia_urls.cc b/chrome/common/net/gaia/gaia_urls.cc |
index 49a33c02d5ef83df6bec5d6d3a2d68f2eee50d05..92ed7344654b17566693f45d66ba56a9537d8e49 100644 |
--- a/chrome/common/net/gaia/gaia_urls.cc |
+++ b/chrome/common/net/gaia/gaia_urls.cc |
@@ -9,20 +9,25 @@ |
namespace { |
-const char kDefaultGaiaBaseUrl[] = "www.google.com"; |
- |
-const char kCaptchaUrlPrefixSuffix[] = "/accounts/"; |
-const char kClientLoginUrlSuffix[] = "/accounts/ClientLogin"; |
-const char kIssueAuthTokenUrlSuffix[] = "/accounts/IssueAuthToken"; |
-const char kGetUserInfoUrlSuffix[] = "/accounts/GetUserInfo"; |
-const char kTokenAuthUrlSuffix[] = "/accounts/TokenAuth"; |
-const char kMergeSessionUrlSuffix[] = "/accounts/MergeSession"; |
- |
-const char kGetOAuthTokenUrlSuffix[] = "/accounts/o8/GetOAuthToken"; |
-const char kOAuthGetAccessTokenUrlSuffix[] = "/accounts/OAuthGetAccessToken"; |
-const char kOAuthWrapBridgeUrlSuffix[] = "/accounts/OAuthWrapBridge"; |
-const char kOAuth1LoginUrlSuffix[] = "/accounts/OAuthLogin"; |
-const char kOAuthRevokeTokenUrlSuffix[] = "/accounts/AuthSubRevokeToken"; |
+// Gaia service constants |
+const char kDefaultGaiaBaseUrl[] = "accounts.google.com"; |
+ |
+const char kCaptchaUrlPrefixSuffix[] = "/"; |
+const char kClientLoginUrlSuffix[] = "/ClientLogin"; |
+const char kServiceLoginUrlSuffix[] = "/ServiceLogin"; |
+const char kIssueAuthTokenUrlSuffix[] = "/IssueAuthToken"; |
+const char kGetUserInfoUrlSuffix[] = "/GetUserInfo"; |
+const char kTokenAuthUrlSuffix[] = "/TokenAuth"; |
+const char kMergeSessionUrlSuffix[] = "/MergeSession"; |
+ |
+const char kOAuthGetAccessTokenUrlSuffix[] = "/OAuthGetAccessToken"; |
+const char kOAuthWrapBridgeUrlSuffix[] = "/OAuthWrapBridge"; |
+const char kOAuth1LoginUrlSuffix[] = "/OAuthLogin"; |
+const char kOAuthRevokeTokenUrlSuffix[] = "/AuthSubRevokeToken"; |
+ |
+// Federated login constants |
+const char kDefaultFederatedLoginBaseUrl[] = "https://www.google.com/accounts"; |
+const char kGetOAuthTokenUrlSuffix[] = "/o8/GetOAuthToken"; |
// OAuth2 client id for Google Chrome which is registered as an |
// installed application. |
@@ -38,6 +43,7 @@ const char kClientLoginToOAuth2Url[] = |
"https://accounts.google.com/o/oauth2/programmatic_auth"; |
const char kOAuth2TokenUrl[] = |
"https://accounts.google.com/o/oauth2/token"; |
+ |
} // namespacce |
GaiaUrls* GaiaUrls::GetInstance() { |
@@ -56,12 +62,16 @@ GaiaUrls::GaiaUrls() { |
captcha_url_prefix_ = "http://" + host_base + kCaptchaUrlPrefixSuffix; |
gaia_origin_url_ = "https://" + host_base; |
client_login_url_ = gaia_origin_url_ + kClientLoginUrlSuffix; |
+ service_login_url_ = gaia_origin_url_ + kServiceLoginUrlSuffix; |
issue_auth_token_url_ = gaia_origin_url_ + kIssueAuthTokenUrlSuffix; |
get_user_info_url_ = gaia_origin_url_ + kGetUserInfoUrlSuffix; |
token_auth_url_ = gaia_origin_url_ + kTokenAuthUrlSuffix; |
merge_session_url_ = gaia_origin_url_ + kMergeSessionUrlSuffix; |
- get_oauth_token_url_ = gaia_origin_url_ + kGetOAuthTokenUrlSuffix; |
+ // Federated login is not part of Gaia and has its own endpoints. |
+ get_oauth_token_url_ = std::string(kDefaultFederatedLoginBaseUrl) + |
+ kGetOAuthTokenUrlSuffix; |
+ |
oauth_get_access_token_url_ = gaia_origin_url_ + |
kOAuthGetAccessTokenUrlSuffix; |
oauth_wrap_bridge_url_ = gaia_origin_url_ + kOAuthWrapBridgeUrlSuffix; |
@@ -97,6 +107,10 @@ const std::string& GaiaUrls::client_login_url() { |
return client_login_url_; |
} |
+const std::string& GaiaUrls::service_login_url() { |
+ return service_login_url_; |
+} |
+ |
const std::string& GaiaUrls::issue_auth_token_url() { |
return issue_auth_token_url_; |
} |