From 45c2af80a36d921bce3a569a2fae778cdaf7ea6b Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 16 Oct 2017 09:00:51 -0700 Subject: [PATCH] More LDAP testing US refinements --- .../Controllers/Api/SettingsController.php | 3 +- app/Models/Ldap.php | 2 + resources/views/settings/ldap.blade.php | 79 ++++++++++++++----- 3 files changed, 64 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/Api/SettingsController.php b/app/Http/Controllers/Api/SettingsController.php index 15b4d9eb8a..6cc6724e09 100644 --- a/app/Http/Controllers/Api/SettingsController.php +++ b/app/Http/Controllers/Api/SettingsController.php @@ -123,6 +123,7 @@ class SettingsController extends Controller $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { \Log::debug('LDAP Validation test failed.'); + $validation_errors = implode(' ',$validator->errors()->all()); return response()->json(['message' => $validator->errors()->all()], 400); } @@ -153,7 +154,7 @@ class SettingsController extends Controller } } catch (\Exception $e) { \Log::debug('Connection failed'); - return response()->json(['message' => $e->getMessage()], 600); + return response()->json(['message' => $e->getMessage()], 500); } diff --git a/app/Models/Ldap.php b/app/Models/Ldap.php index 0a68e15407..d46dabdd59 100644 --- a/app/Models/Ldap.php +++ b/app/Models/Ldap.php @@ -96,6 +96,8 @@ class Ldap extends Model $userDn = $ldap_username_field.'='.$username.','.$settings->ldap_basedn; } + \Log::debug('Attempting to login using distinguished name:'.$userDn); + $filterQuery = $settings->ldap_auth_filter_query . $username; diff --git a/resources/views/settings/ldap.blade.php b/resources/views/settings/ldap.blade.php index 1232f89c8a..1543103ecb 100644 --- a/resources/views/settings/ldap.blade.php +++ b/resources/views/settings/ldap.blade.php @@ -335,10 +335,12 @@ Test LDAP Sync
- Test LDAP - - - + Test LDAP +
+
+ + +

This only tests that LDAP can sync correctly. If your LDAP Authentication query is not correct, users may still not be able to login.

@@ -350,7 +352,7 @@
Test LDAP Login
-
+
@@ -361,12 +363,12 @@ - +
- +
@@ -404,10 +406,10 @@ @section('moar_scripts')