diff options
author | pavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-13 23:52:03 +0000 |
---|---|---|
committer | pavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-13 23:52:03 +0000 |
commit | b67c18c667575649126831940f07e3c420d29cfc (patch) | |
tree | 9003b7db2b0aebc3ef7df5ecf221834ec1393fa6 /jingle | |
parent | effc83ba229132cabfa86df3a396b564a573f38c (diff) | |
download | chromium_src-b67c18c667575649126831940f07e3c420d29cfc.zip chromium_src-b67c18c667575649126831940f07e3c420d29cfc.tar.gz chromium_src-b67c18c667575649126831940f07e3c420d29cfc.tar.bz2 |
Use OAuth2 token for sync
ProfileSyncService requests access token from OAuth2TokenService and passes it
to ServerConnectionManager through UpdateCredentials. When server returns
AUTH_ERROR it gets propagated to ProfileSyncService through OnGetStatusChange
call. At this point ProfileSyncService needs to invalidate old token with
OAuth2TokenService and request a new one.
Access token is requested in PSS::StartUp since this is the place where all
preconditions are verified. There is a call to pre-request access token in
Initialize and Observe after Login token is loaded.
There are still two tests disabled, I'll fix them and update this CR.
BUG=226464
TBR=jhawkins@chromium.org
Review URL: https://chromiumcodereview.appspot.com/15421011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206224 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r-- | jingle/notifier/base/notifier_options_util.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/jingle/notifier/base/notifier_options_util.cc b/jingle/notifier/base/notifier_options_util.cc index 93bd173..fa48209 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); |