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

Unified Diff: chromeos/dbus/auth_policy_client.h

Issue 2519823006: Chromad: Add authentication flow (Closed)
Patch Set: Fix profile creation, mojo types + rebase. Created 4 years 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
Index: chromeos/dbus/auth_policy_client.h
diff --git a/chromeos/dbus/auth_policy_client.h b/chromeos/dbus/auth_policy_client.h
index 1947b4a5d1d67a945d1abc0b374c8dd2c5b6df84..29fc44b66569bb698194b58a8ca9ca8c0bd55b1b 100644
--- a/chromeos/dbus/auth_policy_client.h
+++ b/chromeos/dbus/auth_policy_client.h
@@ -15,11 +15,19 @@
// (see crbug.com/659732)
namespace authpolicy {
namespace types {
+
enum ADJoinErrorType {
AD_JOIN_ERROR_NONE = 0,
AD_JOIN_ERROR_UNKNOWN = 1,
AD_JOIN_ERROR_DBUS_FAIL = 2,
};
+
+enum AuthUserErrorType {
+ AUTH_USER_ERROR_NONE = 0,
+ AUTH_USER_ERROR_UNKNOWN = 1,
+ AUTH_USER_ERROR_DBUS_FAILURE = 2,
+};
+
} // namespace types
} // namespace authpolicy
@@ -30,6 +38,10 @@ namespace chromeos {
// initializes the DBusThreadManager instance.
class CHROMEOS_EXPORT AuthPolicyClient : public DBusClient {
public:
+ // |user_id| is a unique id for the users. Using objectGUID from Active
+ // Directory server.
+ using AuthCallback =
+ base::Callback<void(int error_code, const std::string& user_id)>;
using JoinCallback = base::Callback<void(int error_code)>;
using RefreshPolicyCallback = base::Callback<void(bool success)>;
@@ -41,16 +53,24 @@ class CHROMEOS_EXPORT AuthPolicyClient : public DBusClient {
// Calls JoinADDomain. It runs "net ads join ..." which joins machine to
// Active directory domain.
- // |machine_name| is a name for a local machine. |user|,
+ // |machine_name| is a name for a local machine. |user_principal_name|,
// |password_fd| are credentials of the Active directory account which has
// right to join the machine to the domain. |password_fd| is a file descriptor
// password is read from. The caller should close it after the call.
- // |callback| is called after the method call succeeds.
+ // |callback| is called after getting (or failing to get) D-BUS response.
virtual void JoinAdDomain(const std::string& machine_name,
- const std::string& user,
+ const std::string& user_principal_name,
int password_fd,
const JoinCallback& callback) = 0;
+ // Calls AuthenticateUser. It runs "kinit <user_principal_name> .. " which
+ // does kerberos authentication against Active Directory server.
+ // |password_fd| is similar to the one in the JoinAdDomain.
+ // |callback| is called after getting (or failing to get) D-BUS response.
+ virtual void AuthenticateUser(const std::string& user_principal_name,
+ int password_fd,
+ const AuthCallback& callback) = 0;
+
// Calls RefreshDevicePolicy - handle policy for the device.
// Fetch GPO files from Active directory server, parse it, encode it into
// protobuf and send to SessionManager. Callback is called after that.

Powered by Google App Engine
This is Rietveld 408576698