summaryrefslogtreecommitdiffstats
path: root/remoting/client
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 19:01:08 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 19:01:08 +0000
commit722d8eab5034806b347a17cd5c6a10a98feb35f9 (patch)
tree5f9ae56c70ae1a815a519e1f6de652560138da55 /remoting/client
parentc551e2fcd56d5c05305414d6384aa74a359e22df (diff)
downloadchromium_src-722d8eab5034806b347a17cd5c6a10a98feb35f9.zip
chromium_src-722d8eab5034806b347a17cd5c6a10a98feb35f9.tar.gz
chromium_src-722d8eab5034806b347a17cd5c6a10a98feb35f9.tar.bz2
Token-based authentication for chromoting.
BUG=none TEST=none Review URL: http://codereview.chromium.org/2749004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r--remoting/client/host_connection.cc6
-rw-r--r--remoting/client/host_connection.h2
-rw-r--r--remoting/client/simple_client.cc13
3 files changed, 10 insertions, 11 deletions
diff --git a/remoting/client/host_connection.cc b/remoting/client/host_connection.cc
index f858af6..00c542e 100644
--- a/remoting/client/host_connection.cc
+++ b/remoting/client/host_connection.cc
@@ -4,6 +4,8 @@
#include "remoting/client/host_connection.h"
+#include "remoting/base/constants.h"
+
namespace remoting {
HostConnection::HostConnection(ProtocolDecoder* decoder,
@@ -16,10 +18,10 @@ HostConnection::~HostConnection() {
}
void HostConnection::Connect(const std::string& username,
- const std::string& password,
+ const std::string& auth_token,
const std::string& host_jid) {
jingle_client_ = new JingleClient();
- jingle_client_->Init(username, password, this);
+ jingle_client_->Init(username, auth_token, kChromotingTokenServiceName, this);
jingle_channel_ = jingle_client_->Connect(host_jid, this);
}
diff --git a/remoting/client/host_connection.h b/remoting/client/host_connection.h
index af1fda7..8cd2a76 100644
--- a/remoting/client/host_connection.h
+++ b/remoting/client/host_connection.h
@@ -47,7 +47,7 @@ class HostConnection : public JingleChannel::Callback,
virtual ~HostConnection();
- void Connect(const std::string& username, const std::string& password,
+ void Connect(const std::string& username, const std::string& auth_token,
const std::string& host_jid);
void Disconnect();
diff --git a/remoting/client/simple_client.cc b/remoting/client/simple_client.cc
index ff74312..da65b2a 100644
--- a/remoting/client/simple_client.cc
+++ b/remoting/client/simple_client.cc
@@ -176,19 +176,16 @@ int main(int argc, char** argv) {
return 1;
}
- // Get password (with console echo turned off).
- std::string password;
- SetConsoleEcho(false);
- std::cout << "Password: ";
- getline(std::cin, password);
- SetConsoleEcho(true);
- std::cout << std::endl;
+ // Get auth token.
+ std::string auth_token;
+ std::cout << "Auth Token: ";
+ getline(std::cin, auth_token);
// The message loop that everything runs on.
MessageLoop main_loop;
SimpleHostEventHandler handler(&main_loop);
HostConnection connection(new ProtocolDecoder(), &handler);
- connection.Connect(username, password, host_jid);
+ connection.Connect(username, auth_token, host_jid);
// Run the message.
main_loop.Run();