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

Unified Diff: remoting/jingle_glue/jingle_test_client.cc

Issue 2749004: Token-based authentication for chromoting. (Closed)
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.cc ('k') | remoting/tools/gettoken.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/jingle_test_client.cc
diff --git a/remoting/jingle_glue/jingle_test_client.cc b/remoting/jingle_glue/jingle_test_client.cc
index 38677fe57dcffc4cbb739d0a56f79f9e1798f1f3..7bf33c03f92f606a09c046d0abff4e0757ea1542 100644
--- a/remoting/jingle_glue/jingle_test_client.cc
+++ b/remoting/jingle_glue/jingle_test_client.cc
@@ -15,11 +15,13 @@ extern "C" {
#include "base/at_exit.h"
#include "media/base/data_buffer.h"
+#include "remoting/base/constants.h"
#include "remoting/jingle_glue/jingle_channel.h"
#include "remoting/jingle_glue/jingle_client.h"
using remoting::JingleClient;
using remoting::JingleChannel;
+using remoting::kChromotingTokenServiceName;
void SetConsoleEcho(bool on) {
#if defined(OS_WIN)
@@ -51,10 +53,10 @@ class JingleTestClient : public JingleChannel::Callback,
public:
virtual ~JingleTestClient() {}
- void Run(const std::string& username, const std::string& password,
+ void Run(const std::string& username, const std::string& auth_token,
const std::string& host_jid) {
client_ = new JingleClient();
- client_->Init(username, password, this);
+ client_->Init(username, auth_token, kChromotingTokenServiceName, this);
if (host_jid != "") {
scoped_refptr<JingleChannel> channel = client_->Connect(host_jid, this);
@@ -144,16 +146,13 @@ int main(int argc, char** argv) {
std::cout << "JID: ";
std::cin >> username;
- std::string password;
- SetConsoleEcho(false);
- std::cout << "Password: ";
- std::cin >> password;
- SetConsoleEcho(true);
- std::cout << std::endl;
+ std::string auth_token;
+ std::cout << "Auth token: ";
+ std::cin >> auth_token;
JingleTestClient client;
- client.Run(username, password, host_jid);
+ client.Run(username, auth_token, host_jid);
return 0;
}
« no previous file with comments | « remoting/jingle_glue/jingle_client.cc ('k') | remoting/tools/gettoken.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698