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

Unified Diff: remoting/jingle_glue/jingle_client.cc

Issue 2724010: Revert 49298 - Broke compile - Token-based authentication for chromoting.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 | « remoting/jingle_glue/jingle_client.h ('k') | remoting/jingle_glue/jingle_test_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/jingle_client.cc
===================================================================
--- remoting/jingle_glue/jingle_client.cc (revision 49299)
+++ remoting/jingle_glue/jingle_client.cc (working copy)
@@ -7,7 +7,6 @@
#include "base/logging.h"
#include "base/waitable_event.h"
#include "base/message_loop.h"
-#include "chrome/common/net/notifier/communicator/gaia_token_pre_xmpp_auth.h"
#include "chrome/common/net/notifier/communicator/xmpp_socket_adapter.h"
#include "remoting/jingle_glue/jingle_thread.h"
#include "remoting/jingle_glue/relay_port_allocator.h"
@@ -19,8 +18,6 @@
#include "talk/session/tunnel/securetunnelsessionclient.h"
#endif
#include "talk/session/tunnel/tunnelsessionclient.h"
-#include "talk/xmpp/prexmppauth.h"
-#include "talk/xmpp/saslcookiemechanism.h"
namespace remoting {
@@ -33,20 +30,22 @@
DCHECK(state_ == CLOSED);
}
-void JingleClient::Init(
- const std::string& username, const std::string& auth_token,
- const std::string& auth_token_service, Callback* callback) {
+void JingleClient::Init(const std::string& username,
+ const std::string& password,
+ Callback* callback) {
DCHECK(username != "");
DCHECK(callback != NULL);
DCHECK(thread_ == NULL); // Init() can be called only once.
callback_ = callback;
+ username_ = username;
+ password_ = password;
+
thread_.reset(new JingleThread());
thread_->Start();
thread_->message_loop()->PostTask(
- FROM_HERE, NewRunnableMethod(this, &JingleClient::DoInitialize,
- username, auth_token, auth_token_service));
+ FROM_HERE, NewRunnableMethod(this, &JingleClient::DoInitialize));
}
class JingleClient::ConnectRequest {
@@ -109,28 +108,27 @@
UpdateState(CLOSED);
}
-void JingleClient::DoInitialize(const std::string& username,
- const std::string& auth_token,
- const std::string& auth_token_service) {
- buzz::Jid login_jid(username);
+void JingleClient::DoInitialize() {
+ buzz::Jid login_jid(username_);
+ talk_base::InsecureCryptStringImpl password;
+ password.password() = password_;
- buzz::XmppClientSettings settings;
- settings.set_user(login_jid.node());
- settings.set_host(login_jid.domain());
- settings.set_resource("chromoting");
- settings.set_use_tls(true);
- settings.set_token_service(auth_token_service);
- settings.set_auth_cookie(auth_token);
- settings.set_server(talk_base::SocketAddress("talk.google.com", 5222));
+ buzz::XmppClientSettings xcs;
+ xcs.set_user(login_jid.node());
+ xcs.set_host(login_jid.domain());
+ xcs.set_resource("chromoting");
+ xcs.set_use_tls(true);
+ xcs.set_pass(talk_base::CryptString(password));
+ xcs.set_server(talk_base::SocketAddress("talk.google.com", 5222));
client_ = new buzz::XmppClient(thread_->task_pump());
client_->SignalStateChange.connect(
this, &JingleClient::OnConnectionStateChanged);
buzz::AsyncSocket* socket =
- new notifier::XmppSocketAdapter(settings, false);
+ new notifier::XmppSocketAdapter(xcs, false);
- client_->Connect(settings, "", socket, CreatePreXmppAuth(settings));
+ client_->Connect(xcs, "", socket, NULL);
client_->Start();
network_manager_.reset(new talk_base::NetworkManager());
@@ -226,11 +224,4 @@
}
}
-buzz::PreXmppAuth* JingleClient::CreatePreXmppAuth(
- const buzz::XmppClientSettings& settings) {
- buzz::Jid jid(settings.user(), settings.host(), buzz::STR_EMPTY);
- return new notifier::GaiaTokenPreXmppAuth(jid.Str(), settings.auth_cookie(),
- settings.token_service());
-}
-
} // namespace remoting
« no previous file with comments | « remoting/jingle_glue/jingle_client.h ('k') | remoting/jingle_glue/jingle_test_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698