diff options
Diffstat (limited to 'remoting/protocol')
-rw-r--r-- | remoting/protocol/connection_to_host.cc | 4 | ||||
-rw-r--r-- | remoting/protocol/connection_to_host.h | 1 | ||||
-rw-r--r-- | remoting/protocol/protocol_test_client.cc | 14 |
3 files changed, 12 insertions, 7 deletions
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc index f4a82f3..c86370e 100644 --- a/remoting/protocol/connection_to_host.cc +++ b/remoting/protocol/connection_to_host.cc @@ -55,6 +55,7 @@ MessageLoop* ConnectionToHost::message_loop() { void ConnectionToHost::Connect(const std::string& username, const std::string& auth_token, + const std::string& auth_service, const std::string& host_jid, const std::string& access_code, HostEventCallback* event_callback, @@ -67,8 +68,7 @@ void ConnectionToHost::Connect(const std::string& username, // Initialize |jingle_client_|. signal_strategy_.reset( - new XmppSignalStrategy(thread_, username, auth_token, - kChromotingTokenServiceName)); + new XmppSignalStrategy(thread_, username, auth_token, auth_service)); jingle_client_ = new JingleClient(thread_, signal_strategy_.get(), network_manager_.release(), socket_factory_.release(), diff --git a/remoting/protocol/connection_to_host.h b/remoting/protocol/connection_to_host.h index ac88645..bf990ac 100644 --- a/remoting/protocol/connection_to_host.h +++ b/remoting/protocol/connection_to_host.h @@ -73,6 +73,7 @@ class ConnectionToHost : public JingleClient::Callback { // TODO(ajwong): We need to generalize this API. virtual void Connect(const std::string& username, const std::string& auth_token, + const std::string& auth_service, const std::string& host_jid, const std::string& access_code, HostEventCallback* event_callback, diff --git a/remoting/protocol/protocol_test_client.cc b/remoting/protocol/protocol_test_client.cc index 9d01c32..2b8aefb 100644 --- a/remoting/protocol/protocol_test_client.cc +++ b/remoting/protocol/protocol_test_client.cc @@ -27,8 +27,6 @@ extern "C" { #include "remoting/jingle_glue/jingle_thread.h" #include "remoting/protocol/jingle_session_manager.h" -using remoting::kChromotingTokenServiceName; - namespace remoting { namespace protocol { @@ -93,7 +91,7 @@ class ProtocolTestClient virtual ~ProtocolTestClient() {} void Run(const std::string& username, const std::string& auth_token, - const std::string& host_jid); + const std::string& auth_service, const std::string& host_jid); void OnConnectionClosed(ProtocolTestConnection* connection); @@ -223,12 +221,13 @@ void ProtocolTestConnection::HandleReadResult(int result) { void ProtocolTestClient::Run(const std::string& username, const std::string& auth_token, + const std::string& auth_service, const std::string& host_jid) { remoting::JingleThread jingle_thread; jingle_thread.Start(); signal_strategy_.reset( new XmppSignalStrategy(&jingle_thread, username, auth_token, - kChromotingTokenServiceName)); + auth_service)); client_ = new JingleClient(&jingle_thread, signal_strategy_.get(), NULL, NULL, NULL, this); client_->Init(); @@ -374,9 +373,14 @@ int main(int argc, char** argv) { usage(argv[0]); std::string auth_token(cmd_line->GetSwitchValueASCII("auth_token")); + // Default to OAuth2 for the auth token. + std::string auth_service("oauth2"); + if (cmd_line->HasSwitch("auth_service")) + auth_service = cmd_line->GetSwitchValueASCII("auth_service"); + scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); - client->Run(username, auth_token, host_jid); + client->Run(username, auth_token, host_jid, auth_service); return 0; } |