summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-30 17:39:43 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-30 17:39:43 +0000
commite282cc6f4fac08ea49aa438c03bb46e256cf8c7b (patch)
tree63eabe0adf87f330059c01a22632bb69f46bb5f6 /google_apis
parent287effe6d3b8a1653243d5a79d1eb813ca537be5 (diff)
downloadchromium_src-e282cc6f4fac08ea49aa438c03bb46e256cf8c7b.zip
chromium_src-e282cc6f4fac08ea49aa438c03bb46e256cf8c7b.tar.gz
chromium_src-e282cc6f4fac08ea49aa438c03bb46e256cf8c7b.tar.bz2
Few imporant fixes needed for kiosk app for robot accounts:
* added TokenService initialization for kiosk app launch * wired up kiosk robot account auth file (/home/chronos/kiosk_auth) processing - we can now read value of oauth2 refresh token + client id/secret that will be used for Identity API calls in kiosk mode. BUG=224129 TEST=manual kiosk test Review URL: https://chromiumcodereview.appspot.com/12918030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/oauth2_api_call_flow.cc16
-rw-r--r--google_apis/gaia/oauth2_api_call_flow.h9
2 files changed, 23 insertions, 2 deletions
diff --git a/google_apis/gaia/oauth2_api_call_flow.cc b/google_apis/gaia/oauth2_api_call_flow.cc
index a6a267c..ee0643f 100644
--- a/google_apis/gaia/oauth2_api_call_flow.cc
+++ b/google_apis/gaia/oauth2_api_call_flow.cc
@@ -41,6 +41,9 @@ OAuth2ApiCallFlow::OAuth2ApiCallFlow(
refresh_token_(refresh_token),
access_token_(access_token),
scopes_(scopes),
+ chrome_client_id_(GaiaUrls::GetInstance()->oauth2_chrome_client_id()),
+ chrome_client_secret_(
+ GaiaUrls::GetInstance()->oauth2_chrome_client_secret()),
state_(INITIAL),
tried_mint_access_token_(false) {
}
@@ -51,6 +54,15 @@ void OAuth2ApiCallFlow::Start() {
BeginApiCall();
}
+#if defined(OS_CHROMEOS)
+void OAuth2ApiCallFlow::SetChromeOAuthClientInfo(
+ const std::string& chrome_client_id,
+ const std::string& chrome_client_secret) {
+ chrome_client_id_ = chrome_client_id;
+ chrome_client_secret_ = chrome_client_secret;
+}
+#endif
+
void OAuth2ApiCallFlow::BeginApiCall() {
CHECK(state_ == INITIAL || state_ == MINT_ACCESS_TOKEN_DONE);
@@ -106,8 +118,8 @@ void OAuth2ApiCallFlow::BeginMintAccessToken() {
oauth2_access_token_fetcher_.reset(CreateAccessTokenFetcher());
oauth2_access_token_fetcher_->Start(
- GaiaUrls::GetInstance()->oauth2_chrome_client_id(),
- GaiaUrls::GetInstance()->oauth2_chrome_client_secret(),
+ chrome_client_id_,
+ chrome_client_secret_,
refresh_token_,
scopes_);
}
diff --git a/google_apis/gaia/oauth2_api_call_flow.h b/google_apis/gaia/oauth2_api_call_flow.h
index fccd1e7..fa7dd5c 100644
--- a/google_apis/gaia/oauth2_api_call_flow.h
+++ b/google_apis/gaia/oauth2_api_call_flow.h
@@ -50,6 +50,11 @@ class OAuth2ApiCallFlow
// Start the flow.
virtual void Start();
+#if defined(OS_CHROMEOS)
+ void SetChromeOAuthClientInfo(const std::string& chrome_client_id,
+ const std::string& chrome_client_secret);
+#endif
+
// OAuth2AccessTokenFetcher implementation.
virtual void OnGetTokenSuccess(const std::string& access_token,
const base::Time& expiration_time) OVERRIDE;
@@ -113,6 +118,10 @@ class OAuth2ApiCallFlow
std::string access_token_;
std::vector<std::string> scopes_;
+ // Override values for the main chrome client id and secret.
+ std::string chrome_client_id_;
+ std::string chrome_client_secret_;
+
State state_;
// Whether we have already tried minting an access token once.
bool tried_mint_access_token_;