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

Side by Side Diff: remoting/base/auth_token_util.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, 9 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 unified diff | Download patch
« no previous file with comments | « remoting/base/auth_token_util.h ('k') | remoting/base/auth_token_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/base/auth_token_util.h"
6 #include "remoting/base/constants.h"
7
8 namespace remoting {
9
10 void ParseAuthTokenWithService(const std::string& auth_service_with_token,
11 std::string* auth_token,
12 std::string* auth_service) {
13 size_t delimiter_pos = auth_service_with_token.find(':');
14 if (delimiter_pos == std::string::npos) {
15 // Legacy case: there is no delimiter. Assume the whole string is the
16 // auth_token, and that we're using the default service.
17 //
18 // TODO(ajwong): Remove this defaulting once all webclients are migrated.
19 // BUG:83897
20 auth_token->assign(auth_service_with_token);
21 auth_service->assign(kChromotingTokenDefaultServiceName);
22 } else {
23 auth_service->assign(auth_service_with_token.substr(0, delimiter_pos));
24
25 // Make sure there is *something* after the delimiter before doing substr.
26 if (delimiter_pos < auth_service_with_token.size()) {
27 auth_token->assign(auth_service_with_token.substr(delimiter_pos + 1));
28 } else {
29 auth_token->clear();
30 }
31 }
32 }
33
34 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/auth_token_util.h ('k') | remoting/base/auth_token_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698