snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.89k stars 3.14k forks source link

Unable login with a LDAP user - Jumpcloud - "Unable to validate user credentials!" #10013

Open maorweissSV opened 3 years ago

maorweissSV commented 3 years ago

Please confirm you have done the following before posting your bug report:

Describe the bug After successfully LDAP sync test I'm getting the "Unable to validate user credentials!" error. I'm using the JumpCloud configuration settings for LDAP sync and it's working properly without user login.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Admin'
  2. Click on LDAP'
  3. Scroll down to 'Test LDAP Login'
  4. See the error "Unable to validate user credentials!"

Expected behavior Successful log messages and successful login of the users.

Screenshots image image image image

Server (please complete the following information):

Desktop (please complete the following information):

welcome[bot] commented 3 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

uberbrady commented 3 years ago

Snipe-IT performs logins by doing an LDAP bind as your user - does your user have bind permissions? I've definitely seen that on Jumpcloud before.

Under "User Security Settings and Permissions" - check the box for "Enable as LDAP Bind DN".

Does that work any better?

maorweissSV commented 3 years ago

Thank you @uberbrady for the reply :) I've configured my user as you suggested on JumpCloud 5 hours ago and I've resync LDAP with the sudo artisan snipeit:ldap-sync command right now.

Unfurthently, I still see the same Base table or view not found log error when I'm trying to test the LDAP credentials again. image

Is there any other idea of what can I do to solve this issue?

uberbrady commented 3 years ago

That sounds like possible missing migrations? What happens if you run php artisan migrate - paste your output here if you wouldn't mind, especially so if it errors (of course, if it fixes it, then you can just close the issue and say that that fixed it :) )

maorweissSV commented 3 years ago

Sorry... Nothing to migrate. image

maorweissSV commented 3 years ago

Same issue, but I'm open to new ideas :)

uberbrady commented 3 years ago

Any way you can get us more of that error message? "Base table or view not found" is probably not a particularly good situation for us to be in, and we'll probably need to fix it, if we can figure out what 'it' is.

maorweissSV commented 3 years ago

Thanks @uberbrady ,

The full error message is: `[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'snipeitdb.users' doesn't exist at /var/www/snipeit/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:79) [stacktrace]

0 /var/www/snipeit/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(79): PDO->prepare()

1 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): Doctrine\DBAL\Driver\PDOConnection->prepare()

2 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\Database\Connection->Illuminate\Database\{closure}()

3 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback()

4 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Illuminate\Database\Connection->run()

5 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2159): Illuminate\Database\Connection->select()

6 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2147): Illuminate\Database\Query\Builder->runSelect()

7 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2619): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()

8 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2148): Illuminate\Database\Query\Builder->onceWithColumns()

9 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(546): Illuminate\Database\Query\Builder->get()

10 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(530): Illuminate\Database\Eloquent\Builder->getModels()

11 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(143): Illuminate\Database\Eloquent\Builder->get()

12 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php(52): Illuminate\Database\Eloquent\Builder->first()

13 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php(139): Illuminate\Auth\EloquentUserProvider->retrieveById()

14 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php(60): Illuminate\Auth\SessionGuard->user()

15 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php(307): Illuminate\Auth\SessionGuard->check()

16 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Auth\AuthManager->__call()

17 /var/www/snipeit/app/Http/Middleware/CheckForDebug.php(21): Illuminate\Support\Facades\Facade::__callStatic()

18 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\CheckForDebug->handle()

19 /var/www/snipeit/app/Http/Middleware/CheckForSetup.php(34): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

20 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\CheckForSetup->handle()

21 /var/www/snipeit/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

22 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle()

23 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

24 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\View\Middleware\ShareErrorsFromSession->handle()

25 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

26 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Session\Middleware\StartSession->handle()

27 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

28 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()

29 /var/www/snipeit/app/Http/Middleware/NoSessionStore.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

30 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\NoSessionStore->handle()

31 /var/www/snipeit/vendor/barryvdh/laravel-cors/src/HandlePreflight.php(29): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

32 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Barryvdh\Cors\HandlePreflight->handle()

33 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

34 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Pipeline\Pipeline->then()

35 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()

36 /var/www/snipeit/public/index.php(57): Illuminate\Foundation\Http\Kernel->handle()

37 {main}

"} `.

My table name is 'snipeitdb'. As you can see, it should work. image

uberbrady commented 3 years ago

Somehow, your Snipe-IT environment can't see your database, or it's maybe looking at the wrong one? If your Snipe-IT web application works, you should be able to run stuff similarly via the command-line.

Try php artisan list and make sure you get output. Try php artisan tinker and then try something like $s=App\Models\Setting::first() - that should give you a dump of your settings, which are stored in the database.

This way we can at least confirm that your command-line environment can at least connect to your database the same way the web application can.

maorweissSV commented 3 years ago

Thanks for the support, @uberbrady ! After checking the DB connection by your instructions, I've got this.

image

Is there something particular that we need from this output?