From cb4ff35adbdb5112b1e9335e05299288b50e054c Mon Sep 17 00:00:00 2001 From: Will Rouesnel Date: Mon, 11 Mar 2019 21:43:02 +1100 Subject: [PATCH] Fix LDAP auth configuration paths. This commit fixes parameters broken in the latest version of `adldap2`. Specifically: * `adldap` auth parameters have changed in the latest version. * "usernames" has become `identities` and `discover` has changed to `discover_users_by`, `auth` has changed to `bind_users_by` * Add the missing objectguid field to the users table for adldap2. * This is added as a nullable (optional) field at the moment to support tracking LDAP users as adldap2 wants to. --- config/ldap_auth.php | 6 +-- .../migrations/2019_03_11_223700_fixldap.php | 43 +++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 database/migrations/2019_03_11_223700_fixldap.php diff --git a/config/ldap_auth.php b/config/ldap_auth.php index 00d6eb5c16..886fff15dc 100644 --- a/config/ldap_auth.php +++ b/config/ldap_auth.php @@ -143,7 +143,7 @@ return [ 'scopes' => $scopes, - 'usernames' => [ + 'identifiers' => [ /* |-------------------------------------------------------------------------- @@ -173,8 +173,8 @@ return [ 'ldap' => [ - 'discover' => envNonEmpty('ADLDAP_DISCOVER_FIELD', 'userprincipalname'), - 'authenticate' => envNonEmpty('ADLDAP_AUTH_FIELD', 'distinguishedname'), + 'locate_users_by' => envNonEmpty('ADLDAP_DISCOVER_FIELD', 'userprincipalname'), + 'bind_users_by' => envNonEmpty('ADLDAP_AUTH_FIELD', 'distinguishedname'), ], diff --git a/database/migrations/2019_03_11_223700_fixldap.php b/database/migrations/2019_03_11_223700_fixldap.php new file mode 100644 index 0000000000..09d9356ac7 --- /dev/null +++ b/database/migrations/2019_03_11_223700_fixldap.php @@ -0,0 +1,43 @@ +dropColumn(['objectguid']); + } + ); + } + + /** + * Run the migrations. + * + * @return void + */ + public function up(): void + { + /** + * ADLdap2 appears to require the ability to store an objectguid for LDAP users + * now. To support this, we add the column. + */ + Schema::table( + 'users', function (Blueprint $table) { + $table->uuid('objectguid')->nullable()->after('id'); + } + ); + } +}