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

Unified Diff: remoting/host/host_plugin.cc

Issue 7008003: Wire in OAuth2 support into non-sandboxed connections in libjingle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
Index: remoting/host/host_plugin.cc
diff --git a/remoting/host/host_plugin.cc b/remoting/host/host_plugin.cc
index 371d91f7e7e71786dfa0946e9508679a386a1435..a9bd51dcc4858f1b5ccadaf2bc69fa6a48ff8066 100644
--- a/remoting/host/host_plugin.cc
+++ b/remoting/host/host_plugin.cc
@@ -25,6 +25,7 @@
#include "base/mac/foundation_util.h"
#endif
#include "media/base/media.h"
+#include "remoting/base/auth_token_util.h"
#include "remoting/host/chromoting_host.h"
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/host_config.h"
@@ -58,7 +59,9 @@
attribute Function void onStateChanged();
- void connect(string uid, string auth_token);
+ // Auth token should be in the format "service:token". And example
Wez 2011/05/25 03:57:46 Typo: And
awong 2011/05/25 16:56:56 Done.
Jamie 2011/05/25 17:04:52 Should we name the parameter explicitly in the com
awong 2011/05/25 18:00:02 Done.
+ // would be "oauth2:1/2a3912vd".
+ void connect(string uid, string auth_token_with_service);
Wez 2011/05/25 03:57:46 If these were called |auth_service_and_token| the
awong 2011/05/25 16:56:56 Done.
void disconnect();
*/
@@ -388,9 +391,17 @@ bool HostNPScriptObject::Connect(const NPVariant* args,
return false;
}
- std::string auth_token = StringFromNPVariant(args[1]);
+ std::string auth_token_with_service = StringFromNPVariant(args[1]);
+ if (auth_token_with_service.empty()) {
Wez 2011/05/25 03:57:46 Why do this test here; the empty token case post-p
awong 2011/05/25 16:56:56 cause I'm silly? :) Fixed.
+ SetException("connect: bad auth_token_with_service argument");
+ return false;
+ }
+ std::string auth_token;
+ std::string auth_service;
+ remoting::ParseAuthTokenWithService(auth_token_with_service, &auth_token,
+ &auth_service);
if (auth_token.empty()) {
Jamie 2011/05/25 17:04:52 Do we need a check for an empty service? The strin
awong 2011/05/25 18:00:02 I'm intentionally not doing that for now so I don'
- SetException("connect: bad auth_token argument");
+ SetException("connect: auth_token_with_service argument has empty token");
return false;
}
@@ -422,6 +433,7 @@ bool HostNPScriptObject::Connect(const NPVariant* args,
new remoting::InMemoryHostConfig;
host_config->SetString(remoting::kXmppLoginConfigPath, uid);
host_config->SetString(remoting::kXmppAuthTokenConfigPath, auth_token);
+ host_config->SetString(remoting::kXmppAuthServiceConfigPath, auth_service);
// Create an access verifier and fetch the host secret.
scoped_ptr<remoting::SupportAccessVerifier> access_verifier;

Powered by Google App Engine
This is Rietveld 408576698