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 3 // found in the LICENSE file. 4 5 #ifndef GOOGLE_APIS_GAIA_GAIA_URLS_H_ 6 #define GOOGLE_APIS_GAIA_GAIA_URLS_H_ 7 8 #include <string> 9 10 #include "base/memory/singleton.h" 11 #include "url/gurl.h" 12 13 // A signleton that provides all the URLs that are used for connecting to GAIA. 14 class GaiaUrls { 15 public: 16 static GaiaUrls* GetInstance(); 17 18 // The URLs for different calls in the Google Accounts programmatic login API. 19 const std::string& captcha_url_prefix() const; 20 21 const GURL& gaia_url() const; 22 const std::string& client_login_url() const; 23 const std::string& service_login_url() const; 24 const std::string& service_logout_url() const; 25 const std::string& issue_auth_token_url() const; 26 const std::string& get_user_info_url() const; 27 const std::string& token_auth_url() const; 28 const std::string& merge_session_url() const; 29 const std::string& get_oauth_token_url() const; 30 const std::string& oauth_get_access_token_url() const; 31 const std::string& oauth_wrap_bridge_url() const; 32 const std::string& oauth_user_info_url() const; 33 const std::string& oauth_revoke_token_url() const; 34 const std::string& oauth1_login_url() const; 35 36 const std::string& oauth1_login_scope() const; 37 const std::string& oauth_wrap_bridge_user_info_scope() const; 38 39 const std::string& oauth2_chrome_client_id() const; 40 const std::string& oauth2_chrome_client_secret() const; 41 const std::string& client_login_to_oauth2_url() const; 42 const std::string& oauth2_auth_url() const; 43 const std::string& oauth2_token_url() const; 44 const std::string& oauth2_issue_token_url() const; 45 const std::string& oauth2_token_info_url() const; 46 const std::string& oauth2_revoke_url() const; 47 48 const std::string& gaia_login_form_realm() const; 49 50 private: 51 GaiaUrls(); 52 ~GaiaUrls(); 53 54 friend struct DefaultSingletonTraits<GaiaUrls>; 55 56 std::string captcha_url_prefix_; 57 58 GURL gaia_url_; 59 std::string lso_origin_url_; 60 std::string google_apis_origin_url_; 61 std::string client_login_url_; 62 std::string service_login_url_; 63 std::string service_logout_url_; 64 std::string issue_auth_token_url_; 65 std::string get_user_info_url_; 66 std::string token_auth_url_; 67 std::string merge_session_url_; 68 std::string get_oauth_token_url_; 69 std::string oauth_get_access_token_url_; 70 std::string oauth_wrap_bridge_url_; 71 std::string oauth_user_info_url_; 72 std::string oauth_revoke_token_url_; 73 std::string oauth1_login_url_; 74 75 std::string oauth1_login_scope_; 76 std::string oauth_wrap_bridge_user_info_scope_; 77 78 std::string oauth2_chrome_client_id_; 79 std::string oauth2_chrome_client_secret_; 80 std::string client_login_to_oauth2_url_; 81 std::string oauth2_auth_url_; 82 std::string oauth2_token_url_; 83 std::string oauth2_issue_token_url_; 84 std::string oauth2_token_info_url_; 85 std::string oauth2_revoke_url_; 86 87 std::string gaia_login_form_realm_; 88 89 DISALLOW_COPY_AND_ASSIGN(GaiaUrls); 90 }; 91 92 #endif // GOOGLE_APIS_GAIA_GAIA_URLS_H_ 93