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

Unified Diff: jingle/notifier/base/notifier_options_util.cc

Issue 15421011: Use OAuth2 token for sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « google_apis/gaia/gaia_constants.cc ('k') | sync/engine/net/server_connection_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/notifier/base/notifier_options_util.cc
diff --git a/jingle/notifier/base/notifier_options_util.cc b/jingle/notifier/base/notifier_options_util.cc
index 93bd173ea8e64b85f636a0e19be7f037ae1eeecb..fa48209ea699a5844288ff88bff8308ff2809cdf 100644
--- a/jingle/notifier/base/notifier_options_util.cc
+++ b/jingle/notifier/base/notifier_options_util.cc
@@ -24,10 +24,13 @@ buzz::XmppClientSettings MakeXmppClientSettings(
xmpp_client_settings.set_resource("chrome-sync");
xmpp_client_settings.set_host(jid.domain());
xmpp_client_settings.set_use_tls(buzz::TLS_ENABLED);
- xmpp_client_settings.set_auth_token(buzz::AUTH_MECHANISM_GOOGLE_TOKEN,
+ xmpp_client_settings.set_auth_token(notifier_options.auth_mechanism,
notifier_options.invalidate_xmpp_login ?
token + "bogus" : token);
- xmpp_client_settings.set_token_service("chromiumsync");
+ if (notifier_options.auth_mechanism == buzz::AUTH_MECHANISM_OAUTH2)
+ xmpp_client_settings.set_token_service("oauth2");
+ else
+ xmpp_client_settings.set_token_service("chromiumsync");
if (notifier_options.allow_insecure_connection) {
xmpp_client_settings.set_allow_plain(true);
xmpp_client_settings.set_use_tls(buzz::TLS_DISABLED);
« no previous file with comments | « google_apis/gaia/gaia_constants.cc ('k') | sync/engine/net/server_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698