Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: chrome/common/net/gaia/gaia_urls.cc

Issue 9549013: Add code to mint OAuth tokens from login-scoped OAuth token. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/net/gaia/gaia_urls.h ('k') | chrome/common/net/gaia/oauth2_mint_token_consumer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_urls.h" 5 #include "chrome/common/net/gaia/gaia_urls.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 9
10 namespace { 10 namespace {
(...skipping 20 matching lines...) Expand all
31 // For an installed application, client secret is not really a secret since 31 // For an installed application, client secret is not really a secret since
32 // it is expected to be embeeded in the application. 32 // it is expected to be embeeded in the application.
33 // See documentation at 33 // See documentation at
34 // http://code.google.com/apis/accounts/docs/OAuth2InstalledApp.html 34 // http://code.google.com/apis/accounts/docs/OAuth2InstalledApp.html
35 static const char kOAuth2ChromeClientSecret[] = 35 static const char kOAuth2ChromeClientSecret[] =
36 "OTJgUOQcT7lO7GsGZq2G4IlT"; 36 "OTJgUOQcT7lO7GsGZq2G4IlT";
37 const char kClientLoginToOAuth2Url[] = 37 const char kClientLoginToOAuth2Url[] =
38 "https://accounts.google.com/o/oauth2/programmatic_auth"; 38 "https://accounts.google.com/o/oauth2/programmatic_auth";
39 const char kOAuth2TokenUrl[] = 39 const char kOAuth2TokenUrl[] =
40 "https://accounts.google.com/o/oauth2/token"; 40 "https://accounts.google.com/o/oauth2/token";
41 const char kOAuth2IssueTokenUrl[] =
42 "https://www.googleapis.com/oauth2/v2/IssueToken";
41 } // namespacce 43 } // namespacce
42 44
43 GaiaUrls* GaiaUrls::GetInstance() { 45 GaiaUrls* GaiaUrls::GetInstance() {
44 return Singleton<GaiaUrls>::get(); 46 return Singleton<GaiaUrls>::get();
45 } 47 }
46 48
47 GaiaUrls::GaiaUrls() { 49 GaiaUrls::GaiaUrls() {
48 CommandLine* command_line = CommandLine::ForCurrentProcess(); 50 CommandLine* command_line = CommandLine::ForCurrentProcess();
49 std::string host_base; 51 std::string host_base;
50 if (command_line->HasSwitch(switches::kGaiaHost)) { 52 if (command_line->HasSwitch(switches::kGaiaHost)) {
(...skipping 22 matching lines...) Expand all
73 // http://crbug.com/97126 75 // http://crbug.com/97126
74 oauth1_login_scope_ = "https://www.google.com/accounts/OAuthLogin"; 76 oauth1_login_scope_ = "https://www.google.com/accounts/OAuthLogin";
75 oauth_user_info_url_ = "https://www.googleapis.com/oauth2/v1/userinfo"; 77 oauth_user_info_url_ = "https://www.googleapis.com/oauth2/v1/userinfo";
76 oauth_wrap_bridge_user_info_scope_ = 78 oauth_wrap_bridge_user_info_scope_ =
77 "https://www.googleapis.com/auth/userinfo.email"; 79 "https://www.googleapis.com/auth/userinfo.email";
78 80
79 oauth2_chrome_client_id_ = kOAuth2ChromeClientId; 81 oauth2_chrome_client_id_ = kOAuth2ChromeClientId;
80 oauth2_chrome_client_secret_ = kOAuth2ChromeClientSecret; 82 oauth2_chrome_client_secret_ = kOAuth2ChromeClientSecret;
81 client_login_to_oauth2_url_ = kClientLoginToOAuth2Url; 83 client_login_to_oauth2_url_ = kClientLoginToOAuth2Url;
82 oauth2_token_url_ = kOAuth2TokenUrl; 84 oauth2_token_url_ = kOAuth2TokenUrl;
85 oauth2_issue_token_url_ = kOAuth2IssueTokenUrl;
83 } 86 }
84 87
85 GaiaUrls::~GaiaUrls() { 88 GaiaUrls::~GaiaUrls() {
86 } 89 }
87 90
88 const std::string& GaiaUrls::captcha_url_prefix() { 91 const std::string& GaiaUrls::captcha_url_prefix() {
89 return captcha_url_prefix_; 92 return captcha_url_prefix_;
90 } 93 }
91 94
92 const std::string& GaiaUrls::gaia_origin_url() { 95 const std::string& GaiaUrls::gaia_origin_url() {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return oauth2_chrome_client_secret_; 156 return oauth2_chrome_client_secret_;
154 } 157 }
155 158
156 const std::string& GaiaUrls::client_login_to_oauth2_url() { 159 const std::string& GaiaUrls::client_login_to_oauth2_url() {
157 return client_login_to_oauth2_url_; 160 return client_login_to_oauth2_url_;
158 } 161 }
159 162
160 const std::string& GaiaUrls::oauth2_token_url() { 163 const std::string& GaiaUrls::oauth2_token_url() {
161 return oauth2_token_url_; 164 return oauth2_token_url_;
162 } 165 }
166
167 const std::string& GaiaUrls::oauth2_issue_token_url() {
168 return oauth2_issue_token_url_;
169 }
OLDNEW
« no previous file with comments | « chrome/common/net/gaia/gaia_urls.h ('k') | chrome/common/net/gaia/oauth2_mint_token_consumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698