OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gaia_urls.h" | 5 #include "google_apis/gaia/gaia_urls.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "google_apis/gaia/gaia_switches.h" | 9 #include "google_apis/gaia/gaia_switches.h" |
10 #include "google_apis/google_api_keys.h" | 10 #include "google_apis/google_api_keys.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 const char kServiceLoginAuthUrlSuffix[] = "ServiceLoginAuth"; | 21 const char kServiceLoginAuthUrlSuffix[] = "ServiceLoginAuth"; |
22 const char kServiceLogoutUrlSuffix[] = "Logout"; | 22 const char kServiceLogoutUrlSuffix[] = "Logout"; |
23 const char kIssueAuthTokenUrlSuffix[] = "IssueAuthToken"; | 23 const char kIssueAuthTokenUrlSuffix[] = "IssueAuthToken"; |
24 const char kGetUserInfoUrlSuffix[] = "GetUserInfo"; | 24 const char kGetUserInfoUrlSuffix[] = "GetUserInfo"; |
25 const char kTokenAuthUrlSuffix[] = "TokenAuth"; | 25 const char kTokenAuthUrlSuffix[] = "TokenAuth"; |
26 const char kMergeSessionUrlSuffix[] = "MergeSession"; | 26 const char kMergeSessionUrlSuffix[] = "MergeSession"; |
27 const char kOAuthGetAccessTokenUrlSuffix[] = "OAuthGetAccessToken"; | 27 const char kOAuthGetAccessTokenUrlSuffix[] = "OAuthGetAccessToken"; |
28 const char kOAuthWrapBridgeUrlSuffix[] = "OAuthWrapBridge"; | 28 const char kOAuthWrapBridgeUrlSuffix[] = "OAuthWrapBridge"; |
29 const char kOAuth1LoginUrlSuffix[] = "OAuthLogin"; | 29 const char kOAuth1LoginUrlSuffix[] = "OAuthLogin"; |
30 const char kOAuthRevokeTokenUrlSuffix[] = "AuthSubRevokeToken"; | 30 const char kOAuthRevokeTokenUrlSuffix[] = "AuthSubRevokeToken"; |
| 31 const char kListAccountsSuffix[] = "ListAccounts"; |
31 | 32 |
32 // OAuth scopes | 33 // OAuth scopes |
33 const char kOAuth1LoginScope[] = "https://www.google.com/accounts/OAuthLogin"; | 34 const char kOAuth1LoginScope[] = "https://www.google.com/accounts/OAuthLogin"; |
34 const char kOAuthWrapBridgeUserInfoScope[] = | 35 const char kOAuthWrapBridgeUserInfoScope[] = |
35 "https://www.googleapis.com/auth/userinfo.email"; | 36 "https://www.googleapis.com/auth/userinfo.email"; |
36 | 37 |
37 // API calls from accounts.google.com (LSO) | 38 // API calls from accounts.google.com (LSO) |
38 const char kGetOAuthTokenUrlSuffix[] = "o/oauth/GetOAuthToken/"; | 39 const char kGetOAuthTokenUrlSuffix[] = "o/oauth/GetOAuthToken/"; |
39 const char kClientLoginToOAuth2UrlSuffix[] = "o/oauth2/programmatic_auth"; | 40 const char kClientLoginToOAuth2UrlSuffix[] = "o/oauth2/programmatic_auth"; |
40 const char kOAuth2AuthUrlSuffix[] = "o/oauth2/auth"; | 41 const char kOAuth2AuthUrlSuffix[] = "o/oauth2/auth"; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 service_logout_url_ = gaia_url_.Resolve(kServiceLogoutUrlSuffix); | 97 service_logout_url_ = gaia_url_.Resolve(kServiceLogoutUrlSuffix); |
97 issue_auth_token_url_ = gaia_url_.Resolve(kIssueAuthTokenUrlSuffix); | 98 issue_auth_token_url_ = gaia_url_.Resolve(kIssueAuthTokenUrlSuffix); |
98 get_user_info_url_ = gaia_url_.Resolve(kGetUserInfoUrlSuffix); | 99 get_user_info_url_ = gaia_url_.Resolve(kGetUserInfoUrlSuffix); |
99 token_auth_url_ = gaia_url_.Resolve(kTokenAuthUrlSuffix); | 100 token_auth_url_ = gaia_url_.Resolve(kTokenAuthUrlSuffix); |
100 merge_session_url_ = gaia_url_.Resolve(kMergeSessionUrlSuffix); | 101 merge_session_url_ = gaia_url_.Resolve(kMergeSessionUrlSuffix); |
101 oauth_get_access_token_url_ = | 102 oauth_get_access_token_url_ = |
102 gaia_url_.Resolve(kOAuthGetAccessTokenUrlSuffix); | 103 gaia_url_.Resolve(kOAuthGetAccessTokenUrlSuffix); |
103 oauth_wrap_bridge_url_ = gaia_url_.Resolve(kOAuthWrapBridgeUrlSuffix); | 104 oauth_wrap_bridge_url_ = gaia_url_.Resolve(kOAuthWrapBridgeUrlSuffix); |
104 oauth_revoke_token_url_ = gaia_url_.Resolve(kOAuthRevokeTokenUrlSuffix); | 105 oauth_revoke_token_url_ = gaia_url_.Resolve(kOAuthRevokeTokenUrlSuffix); |
105 oauth1_login_url_ = gaia_url_.Resolve(kOAuth1LoginUrlSuffix); | 106 oauth1_login_url_ = gaia_url_.Resolve(kOAuth1LoginUrlSuffix); |
| 107 list_accounts_url_ = gaia_url_.Resolve(kListAccountsSuffix); |
106 | 108 |
107 // URLs from accounts.google.com (LSO). | 109 // URLs from accounts.google.com (LSO). |
108 get_oauth_token_url_ = lso_origin_url_.Resolve(kGetOAuthTokenUrlSuffix); | 110 get_oauth_token_url_ = lso_origin_url_.Resolve(kGetOAuthTokenUrlSuffix); |
109 client_login_to_oauth2_url_ = | 111 client_login_to_oauth2_url_ = |
110 lso_origin_url_.Resolve(kClientLoginToOAuth2UrlSuffix); | 112 lso_origin_url_.Resolve(kClientLoginToOAuth2UrlSuffix); |
111 oauth2_auth_url_ = lso_origin_url_.Resolve(kOAuth2AuthUrlSuffix); | 113 oauth2_auth_url_ = lso_origin_url_.Resolve(kOAuth2AuthUrlSuffix); |
112 oauth2_token_url_ = lso_origin_url_.Resolve(kOAuth2TokenUrlSuffix); | 114 oauth2_token_url_ = lso_origin_url_.Resolve(kOAuth2TokenUrlSuffix); |
113 oauth2_revoke_url_ = lso_origin_url_.Resolve(kOAuth2RevokeUrlSuffix); | 115 oauth2_revoke_url_ = lso_origin_url_.Resolve(kOAuth2RevokeUrlSuffix); |
114 | 116 |
115 // URLs from www.googleapis.com. | 117 // URLs from www.googleapis.com. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 193 } |
192 | 194 |
193 const GURL& GaiaUrls::oauth_revoke_token_url() const { | 195 const GURL& GaiaUrls::oauth_revoke_token_url() const { |
194 return oauth_revoke_token_url_; | 196 return oauth_revoke_token_url_; |
195 } | 197 } |
196 | 198 |
197 const GURL& GaiaUrls::oauth1_login_url() const { | 199 const GURL& GaiaUrls::oauth1_login_url() const { |
198 return oauth1_login_url_; | 200 return oauth1_login_url_; |
199 } | 201 } |
200 | 202 |
| 203 const GURL& GaiaUrls::list_accounts_url() const { |
| 204 return list_accounts_url_; |
| 205 } |
| 206 |
201 const std::string& GaiaUrls::oauth1_login_scope() const { | 207 const std::string& GaiaUrls::oauth1_login_scope() const { |
202 return oauth1_login_scope_; | 208 return oauth1_login_scope_; |
203 } | 209 } |
204 | 210 |
205 const std::string& GaiaUrls::oauth_wrap_bridge_user_info_scope() const { | 211 const std::string& GaiaUrls::oauth_wrap_bridge_user_info_scope() const { |
206 return oauth_wrap_bridge_user_info_scope_; | 212 return oauth_wrap_bridge_user_info_scope_; |
207 } | 213 } |
208 | 214 |
209 const std::string& GaiaUrls::oauth2_chrome_client_id() const { | 215 const std::string& GaiaUrls::oauth2_chrome_client_id() const { |
210 return oauth2_chrome_client_id_; | 216 return oauth2_chrome_client_id_; |
(...skipping 23 matching lines...) Expand all Loading... |
234 return oauth2_token_info_url_; | 240 return oauth2_token_info_url_; |
235 } | 241 } |
236 | 242 |
237 const GURL& GaiaUrls::oauth2_revoke_url() const { | 243 const GURL& GaiaUrls::oauth2_revoke_url() const { |
238 return oauth2_revoke_url_; | 244 return oauth2_revoke_url_; |
239 } | 245 } |
240 | 246 |
241 const GURL& GaiaUrls::gaia_login_form_realm() const { | 247 const GURL& GaiaUrls::gaia_login_form_realm() const { |
242 return gaia_url_; | 248 return gaia_url_; |
243 } | 249 } |
OLD | NEW |