OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/third_party_client_authenticator.h" | 5 #include "remoting/protocol/third_party_client_authenticator.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "remoting/base/constants.h" | 11 #include "remoting/base/constants.h" |
12 #include "remoting/base/rsa_key_pair.h" | 12 #include "remoting/base/rsa_key_pair.h" |
13 #include "remoting/protocol/channel_authenticator.h" | 13 #include "remoting/protocol/channel_authenticator.h" |
14 #include "remoting/protocol/v2_authenticator.h" | 14 #include "remoting/protocol/v2_authenticator.h" |
15 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" | 15 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace remoting { | 18 namespace remoting { |
19 namespace protocol { | 19 namespace protocol { |
20 | 20 |
21 ThirdPartyClientAuthenticator::ThirdPartyClientAuthenticator( | 21 ThirdPartyClientAuthenticator::ThirdPartyClientAuthenticator( |
22 scoped_ptr<TokenFetcher> token_fetcher) | 22 scoped_ptr<TokenFetcher> token_fetcher) |
23 : ThirdPartyAuthenticatorBase(WAITING_MESSAGE), | 23 : ThirdPartyAuthenticatorBase(WAITING_MESSAGE), |
24 token_fetcher_(token_fetcher.Pass()) { | 24 token_fetcher_(std::move(token_fetcher)) { |
25 } | 25 } |
26 | 26 |
27 ThirdPartyClientAuthenticator::~ThirdPartyClientAuthenticator() { | 27 ThirdPartyClientAuthenticator::~ThirdPartyClientAuthenticator() { |
28 } | 28 } |
29 | 29 |
30 void ThirdPartyClientAuthenticator::ProcessTokenMessage( | 30 void ThirdPartyClientAuthenticator::ProcessTokenMessage( |
31 const buzz::XmlElement* message, | 31 const buzz::XmlElement* message, |
32 const base::Closure& resume_callback) { | 32 const base::Closure& resume_callback) { |
33 std::string token_url = message->TextNamed(kTokenUrlTag); | 33 std::string token_url = message->TextNamed(kTokenUrlTag); |
34 std::string token_scope = message->TextNamed(kTokenScopeTag); | 34 std::string token_scope = message->TextNamed(kTokenScopeTag); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } else { | 73 } else { |
74 token_state_ = MESSAGE_READY; | 74 token_state_ = MESSAGE_READY; |
75 underlying_ = V2Authenticator::CreateForClient( | 75 underlying_ = V2Authenticator::CreateForClient( |
76 shared_secret, MESSAGE_READY); | 76 shared_secret, MESSAGE_READY); |
77 } | 77 } |
78 resume_callback.Run(); | 78 resume_callback.Run(); |
79 } | 79 } |
80 | 80 |
81 } // namespace protocol | 81 } // namespace protocol |
82 } // namespace remoting | 82 } // namespace remoting |
OLD | NEW |