snipe / snipe-it

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

Help needed: LDAP and AD users #6484

Closed snipe closed 5 years ago

snipe commented 5 years ago

Thanks to a great PR from @jwhulette, we're well on our way to making LDAP less frustrating in Snipe-IT in v5. We've tested this locally, but could definitely use some help from those of you who have Snipe-IT running with LDAP or AD.

LDAP and AD are always a challenge to test, since different business cases mean different setups for everyone, so it can be a real challenge to try to test every possible case. This is where you come in!

If you can spare the time/resources/etc to set up a test instance with the develop branch, we'd love for you to kick the tires a little more, especially if you have less common cases like very large OUs, unusual directory structures, etc.

This should absolutely not be used in production yet.

The develop branch, while usually somewhat stable, should never be used in a production environment. That's why it's called develop 😁

Remember that the develop branch requires PHP 7.1 or greater.

Would love any feedback you have on the LDAP/AD changes here.

samotelf commented 5 years ago

Hi @snipe I can test this. How can I pull the development version in my PP environment?

snipe commented 5 years ago

Awesome, thanks! You'll probably want a clean VM (or however you have your environment set up). Clone the repo, and then git pull develop, and run migrations. So basically, a regular install, but you want to be working from the develop branch)

rklingaman commented 5 years ago

Was looking to test this and got a new instance all setup just like my old one and then tested to make sure I got logged in locally to it. (all was fine)

Then ran the following: git checkout develop composer install --prefer-source composer dump-autoload php artisan migrate php artisan config:clear php artisan config:cache

And now getting error: In LdapAdConfiguration.php line 88:

Your app key has changed! Could not decrypt LDAP password using your curren t app key, so LDAP authentication has been disabled. Login with a local acc ount, update the LDAP password and re-enable it in Admin > Settings.

snipe commented 5 years ago

I have a temp fix on develop for that now

rklingaman commented 5 years ago

Thanks got in it now and so far this is what I see:

Checkboxes are not visable: image

The checkboxes did work though and I was able to set it up and test successfully. One thing I see initially on this screen is if I go to using "Active Directory" I don't see a way to toggle between ldap and ldaps or port 389 and 636.

When I go to people and try to do an LDAP sync I come up with this:

Symfony\Component\Console\Exception\CommandNotFoundException thrown with message "The command "snipeit:ldapAd-sync" does not exist."

Stacktrace:

78 Symfony\Component\Console\Exception\CommandNotFoundException in /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php:179

77 Illuminate\Console\Application:call in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:250

76 Illuminate\Foundation\Console\Kernel:call in /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:223

75 Illuminate\Support\Facades\Facade:__callStatic in /var/www/html/app/Http/Controllers/Users/LDAPImportController.php:68

74 App\Http\Controllers\Users\LDAPImportController:store in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54

73 call_user_func_array in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54

72 Illuminate\Routing\Controller:callAction in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45

71 Illuminate\Routing\ControllerDispatcher:dispatch in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php:212

70 Illuminate\Routing\Route:runController in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php:169

69 Illuminate\Routing\Route:run in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:682

68 Illuminate\Routing\Router:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30

67 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php:43

66 Illuminate\Auth\Middleware\Authenticate:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

65 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

64 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php:50

63 Laravel\Passport\Http\Middleware\CreateFreshApiToken:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

62 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

61 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/CheckForTwoFactor.php:53

60 App\Http\Middleware\CheckForTwoFactor:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

59 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

58 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/CheckLocale.php:38

57 App\Http\Middleware\CheckLocale:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

56 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

55 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:75

54 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

53 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

52 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37

51 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

50 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

49 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:66

48 Illuminate\Cookie\Middleware\EncryptCookies:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

47 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

46 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104

45 Illuminate\Pipeline\Pipeline:then in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:684

44 Illuminate\Routing\Router:runRouteWithinStack in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:659

43 Illuminate\Routing\Router:runRoute in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:625

42 Illuminate\Routing\Router:dispatchToRoute in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:614

41 Illuminate\Routing\Router:dispatch in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176

40 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30

39 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php:65

38 Barryvdh\Debugbar\Middleware\InjectDebugbar:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

37 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

36 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/CheckForDebug.php:25

35 App\Http\Middleware\CheckForDebug:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

34 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

33 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/CheckForSetup.php:30

32 App\Http\Middleware\CheckForSetup:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

31 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

30 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/fideloper/proxy/src/TrustProxies.php:57

29 Fideloper\Proxy\TrustProxies:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

28 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

27 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/NosniffGuard.php:17

26 App\Http\Middleware\NosniffGuard:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

25 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

24 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/ContentSecurityPolicyHeader.php:18

23 App\Http\Middleware\ContentSecurityPolicyHeader:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

22 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

21 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/ReferrerPolicyHeader.php:17

20 App\Http\Middleware\ReferrerPolicyHeader:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

19 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

18 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/XssProtectHeader.php:18

17 App\Http\Middleware\XssProtectHeader:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

16 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

15 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/app/Http/Middleware/FrameGuard.php:17

14 App\Http\Middleware\FrameGuard:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

13 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

12 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49

11 Illuminate\View\Middleware\ShareErrorsFromSession:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

10 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

9 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:63

8 Illuminate\Session\Middleware\StartSession:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

7 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

6 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:62

5 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

4 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

3 Illuminate\Routing\Pipeline:Illuminate\Routing{closure} in /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104

2 Illuminate\Pipeline\Pipeline:then in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151

1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116

0 Illuminate\Foundation\Http\Kernel:handle in /var/www/html/public/index.php:58

snipe commented 5 years ago

Checkboxes are not visable:

What browser are you using?

snipe commented 5 years ago

(Also are there any other errors in your browser console? I can't reproduce the checkboxes not loading)

rklingaman commented 5 years ago

Was using firefox or Chrome latest versions and happening in both of them. I will play around with it more tomorrow to see if I can dig up why as it seems there are more checkboxes / circles that are disappearing for me besides the ldap ones. Should add that If I refresh I see them for a second before going away.

I did get an LDAP sync to go through with your change so now I will need to test authentication as well.

samotelf commented 5 years ago

I also have the checkboxes problem. I've noticed that if you refresh a lot you can see the checkboxes rendered properly. Anyhow, soon to test ldap.

smb commented 5 years ago

Checkboxes are fixed in https://github.com/snipe/snipe-it/pull/6533/commits/05b326f4c86ca4f269ba541a7e338f61f76974ee but you need to re-run "npm run production" to copy the png files (public/css/*.png should be commited, but there are still some other bugs..)

stale[bot] commented 5 years ago

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] commented 5 years ago

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.