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

Unified Diff: remoting/host/it2me/it2me_native_messaging_host.cc

Issue 959033004: Remove ClientLogin support from remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/host/host_signaling_manager.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_native_messaging_host.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc
index 148dc01fb7aea09df6674da4f24d47a720cabab5..7af2db741aacb653a441080105bce436a574f7a1 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host.cc
@@ -12,13 +12,13 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringize_macros.h"
#include "base/threading/thread.h"
#include "base/values.h"
#include "media/base/media.h"
#include "net/base/net_util.h"
#include "net/url_request/url_request_context_getter.h"
-#include "remoting/base/auth_token_util.h"
#include "remoting/base/service_urls.h"
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/host_exit_codes.h"
@@ -164,16 +164,19 @@ void It2MeNativeMessagingHost::ProcessConnect(
return;
}
- ParseAuthTokenWithService(auth_service_with_token,
- &xmpp_config.auth_token,
- &xmpp_config.auth_service);
- if (xmpp_config.auth_token.empty()) {
- SendErrorAndExit(
- response.Pass(),
- "Invalid 'authServiceWithToken': " + auth_service_with_token);
+ // For backward compatibility the webapp still passes OAuth service as part of
+ // the authServiceWithToken field. But auth service part is always expected to
+ // be set to oauth2.
+ const char kOAuth2ServicePrefix[] = "oauth2:";
+ if (!StartsWithASCII(auth_service_with_token, kOAuth2ServicePrefix, true)) {
+ SendErrorAndExit(response.Pass(), "Invalid 'authServiceWithToken': " +
+ auth_service_with_token);
return;
}
+ xmpp_config.auth_token =
+ auth_service_with_token.substr(strlen(kOAuth2ServicePrefix));
+
#if !defined(NDEBUG)
std::string address;
if (!message.GetString("xmppServerAddress", &address)) {
« no previous file with comments | « remoting/host/host_signaling_manager.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698