| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ | 6 #define CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // |password_fd| are credentials of the Active directory account which has | 42 // |password_fd| are credentials of the Active directory account which has |
| 43 // right to join the machine to the domain. |password_fd| is a file descriptor | 43 // right to join the machine to the domain. |password_fd| is a file descriptor |
| 44 // password is read from. The caller should close it after the call. | 44 // password is read from. The caller should close it after the call. |
| 45 // |callback| is called after getting (or failing to get) D-BUS response. | 45 // |callback| is called after getting (or failing to get) D-BUS response. |
| 46 virtual void JoinAdDomain(const std::string& machine_name, | 46 virtual void JoinAdDomain(const std::string& machine_name, |
| 47 const std::string& user_principal_name, | 47 const std::string& user_principal_name, |
| 48 int password_fd, | 48 int password_fd, |
| 49 JoinCallback callback) = 0; | 49 JoinCallback callback) = 0; |
| 50 | 50 |
| 51 // Calls AuthenticateUser. It runs "kinit <user_principal_name> .. " which | 51 // Calls AuthenticateUser. It runs "kinit <user_principal_name> .. " which |
| 52 // does kerberos authentication against Active Directory server. | 52 // does kerberos authentication against Active Directory server. If |
| 53 // |password_fd| is similar to the one in the JoinAdDomain. | 53 // |object_guid| is not empty authpolicy service first does ldap search by |
| 54 // |callback| is called after getting (or failing to get) D-BUS response. | 54 // that |object_guid| for samAccountName and uses it for kinit. |password_fd| |
| 55 // is similar to the one in the JoinAdDomain. |callback| is called after |
| 56 // getting (or failing to get) D-BUS response. |
| 55 virtual void AuthenticateUser(const std::string& user_principal_name, | 57 virtual void AuthenticateUser(const std::string& user_principal_name, |
| 58 const std::string& object_guid, |
| 56 int password_fd, | 59 int password_fd, |
| 57 AuthCallback callback) = 0; | 60 AuthCallback callback) = 0; |
| 58 | 61 |
| 59 // Calls RefreshDevicePolicy - handle policy for the device. | 62 // Calls RefreshDevicePolicy - handle policy for the device. |
| 60 // Fetch GPO files from Active directory server, parse it, encode it into | 63 // Fetch GPO files from Active directory server, parse it, encode it into |
| 61 // protobuf and send to SessionManager. Callback is called after that. | 64 // protobuf and send to SessionManager. Callback is called after that. |
| 62 virtual void RefreshDevicePolicy(RefreshPolicyCallback callback) = 0; | 65 virtual void RefreshDevicePolicy(RefreshPolicyCallback callback) = 0; |
| 63 | 66 |
| 64 // Calls RefreshUserPolicy - handle policy for the user specified by | 67 // Calls RefreshUserPolicy - handle policy for the user specified by |
| 65 // |account_id|. Similar to RefreshDevicePolicy. | 68 // |account_id|. Similar to RefreshDevicePolicy. |
| 66 virtual void RefreshUserPolicy(const AccountId& account_id, | 69 virtual void RefreshUserPolicy(const AccountId& account_id, |
| 67 RefreshPolicyCallback callback) = 0; | 70 RefreshPolicyCallback callback) = 0; |
| 68 | 71 |
| 69 protected: | 72 protected: |
| 70 // Create() should be used instead. | 73 // Create() should be used instead. |
| 71 AuthPolicyClient(); | 74 AuthPolicyClient(); |
| 72 | 75 |
| 73 private: | 76 private: |
| 74 DISALLOW_COPY_AND_ASSIGN(AuthPolicyClient); | 77 DISALLOW_COPY_AND_ASSIGN(AuthPolicyClient); |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 } // namespace chromeos | 80 } // namespace chromeos |
| 78 | 81 |
| 79 #endif // CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ | 82 #endif // CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ |
| OLD | NEW |