| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef REMOTING_HOST_USER_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_HOST_USER_AUTHENTICATOR_H_ |
| 6 #define REMOTING_HOST_USER_AUTHENTICATOR_H_ | 6 #define REMOTING_HOST_USER_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 namespace remoting { | 10 namespace remoting { |
| 11 | 11 |
| 12 // Interface for authenticating users for access to remote desktop session. | 12 // Interface for authenticating users for access to remote desktop session. |
| 13 // Implementation is platform-specific. | 13 // Implementation is platform-specific. |
| 14 // Implementations may assume each instance of this class handles only a | |
| 15 // single Authenticate request. | |
| 16 | 14 |
| 17 // TODO(lambroslambrou): Decide whether this needs an asychronous interface | 15 // TODO(lambroslambrou): Decide whether this needs an asychronous interface |
| 18 // (for example AuthenticateStart()..AuthenticateEndCallback()), or whether the | 16 // (for example AuthenticateStart()..AuthenticateEndCallback()), or whether the |
| 19 // multi-threading policy could be handled by the caller. | 17 // multi-threading policy could be handled by the caller. |
| 20 class UserAuthenticator { | 18 class UserAuthenticator { |
| 21 public: | 19 public: |
| 22 virtual ~UserAuthenticator() {} | 20 virtual ~UserAuthenticator() {} |
| 23 | 21 |
| 24 // Create platform-specific authenticator. | 22 // Create platform-specific authenticator. |
| 25 static UserAuthenticator* Create(); | 23 static UserAuthenticator* Create(); |
| 26 | 24 |
| 27 // Authenticate a user, returning true if the username/password are valid. | 25 // Authenticate a user, returning true if the username/password are valid. |
| 28 virtual bool Authenticate(const std::string& username, | 26 virtual bool Authenticate(const std::string& username, |
| 29 const std::string& password) = 0; | 27 const std::string& password) = 0; |
| 30 }; | 28 }; |
| 31 | 29 |
| 32 } // namespace remoting | 30 } // namespace remoting |
| 33 | 31 |
| 34 #endif // REMOTING_HOST_USER_AUTHENTICATOR_H_ | 32 #endif // REMOTING_HOST_USER_AUTHENTICATOR_H_ |
| OLD | NEW |