Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable Active directory Authentication in snipe-it #551

Closed
sreejoo opened this issue Feb 23, 2015 · 42 comments
Closed

How to enable Active directory Authentication in snipe-it #551

sreejoo opened this issue Feb 23, 2015 · 42 comments

Comments

@sreejoo
Copy link

sreejoo commented Feb 23, 2015

Hi,

This is an wonderful application to track all IT Assets. Can you please help me to login using Active directory ?
If it is possible, it will more helpful and I can even configure Single Sign on feature to all users, Avoid multiple login for different application.

thanks
Sreejooo

@snipe
Copy link
Owner

snipe commented Feb 24, 2015

Hi @sreejoo - Active Directory/LDAP support is not yet available in Snipe-IT.

@snipe snipe closed this as completed Feb 24, 2015
@omerzubair80
Copy link

Hi - Is Active Directory/LDAP integration available? unable to integrate.

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

@omerzubair80 Yes, AD integration has been part of Snipe-IT since v2.4. https://snipe-it-manual.readme.io/docs/ldap

@omerzubair80
Copy link

Hi - thanks for your response, i tried with the following below settings but its not working in my environment, pls advise how to fix it?

ldap_1
ldap_2

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

Need logs or at the very least an explanation of what you're seeing when you try to import users from LDAP or have an LDAP user login.

@omerzubair80
Copy link

Hi, Im trying to integrate with my Active directory but getting the following error; Also, where can find the logs? pls advise.
ldap_3

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

Are you sure your LDAP server is accessible from the web server you're running this on?

@omerzubair80
Copy link

Yes, the LDAP server is accessible see below the screenshot.

ldap_4

@omerzubair80
Copy link

As requested, here below are the logs for review pls advise how to fix it?
ldap_5

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

I need server logs, as requested in the Getting Help directions. A 500 error doesn't help me if I don't know what the specific error is.

@omerzubair80
Copy link

Hi, can you advise where to enable the debug? new to php.

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

screen shot 2016-09-20 at 8 17 13 am

@omerzubair80
Copy link

No luck to find .env, in centos 7; any idea where to locate?

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

It's there. Try ls -al in your snipeit root directory.

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

(And if it's not there, I have no idea how you got this installation working at all, since creating that file is one of the first things you have to do.)

@omerzubair80
Copy link

I got it, but APP_DEBUG was not present have added the line APP_DEBUG=true. Know where to locate the debug logs files?
ldap_9

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

This is why we ask you to fill in the issue template - knowing how you installed Snipe-IT in the first place would have saved me quite a bit of back and forth with you. Next time, please do not delete the template questions (or at least start your own issue here instead of resurrecting an old, closed thread).

And once again, the information you're looking for is on the same page I keep sending you: https://snipe-it.readme.io/docs/getting-help#step-3-check-your-app-and-server-logs

screen shot 2016-09-20 at 9 11 13 am

I'm happy to try and help you, but you've really got to read the documentation first.

@omerzubair80
Copy link

Hi - here is the requested log file for your review.
logfile.docx

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

Please just paste it in here. I don't open binary files uploaded to github.

@omerzubair80
Copy link

[2016-09-16 12:28:35] production.DEBUG: Authenticating user against database.
[2016-09-19 11:41:32] production.DEBUG: Authenticating user against database.
[2016-09-19 11:41:32] production.DEBUG: Local authentication failed.
[2016-09-19 11:41:40] production.DEBUG: Authenticating user against database.
[2016-09-19 11:41:40] production.DEBUG: Local authentication failed.
[2016-09-19 11:41:48] production.DEBUG: Authenticating user against database.
[2016-09-19 11:41:48] production.DEBUG: Local authentication failed.
[2016-09-19 11:41:56] production.DEBUG: Authenticating user against database.
[2016-09-19 12:58:01] production.DEBUG: LDAP is enabled.
[2016-09-19 12:58:01] production.DEBUG: Local auth lookup complete
[2016-09-19 12:58:06] production.DEBUG: Binding user to LDAP.
[2016-09-19 12:58:06] production.DEBUG: Local user zubair exists in database. Authenticating existing user against LDAP.
[2016-09-19 12:58:06] production.DEBUG: User zubair did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-19 12:58:06] production.DEBUG: Authenticating user against database.
[2016-09-20 10:32:56] production.DEBUG: LDAP is enabled.
[2016-09-20 10:32:56] production.DEBUG: Local auth lookup complete
[2016-09-20 10:32:56] production.DEBUG: Binding user to LDAP.
[2016-09-20 10:32:56] production.DEBUG: Local user zubair@xyz.com does not exist
[2016-09-20 10:32:56] production.DEBUG: User did not authenticate correctly against LDAP. No local user was created.
[2016-09-20 10:32:56] production.DEBUG: Authenticating user against database.
[2016-09-20 10:32:56] production.DEBUG: Local authentication failed.
[2016-09-20 10:33:09] production.DEBUG: LDAP is enabled.
[2016-09-20 10:33:09] production.DEBUG: Local auth lookup complete
[2016-09-20 10:33:09] production.DEBUG: Binding user to LDAP.
[2016-09-20 10:33:09] production.DEBUG: Local user zubair@xyz.com does not exist
[2016-09-20 10:33:09] production.DEBUG: User did not authenticate correctly against LDAP. No local user was created.
[2016-09-20 10:33:09] production.DEBUG: Authenticating user against database.
[2016-09-20 10:33:09] production.DEBUG: Local authentication failed.
[2016-09-20 10:33:28] production.DEBUG: LDAP is enabled.
[2016-09-20 10:33:28] production.DEBUG: Local auth lookup complete
[2016-09-20 10:33:28] production.DEBUG: Binding user to LDAP.
[2016-09-20 10:33:28] production.DEBUG: Local user zubair@xyz.com does not exist
[2016-09-20 10:33:28] production.DEBUG: User did not authenticate correctly against LDAP. No local user was created.
[2016-09-20 10:33:28] production.DEBUG: Authenticating user against database.
[2016-09-20 10:33:28] production.DEBUG: Local authentication failed.
[2016-09-20 10:35:08] production.DEBUG: LDAP is enabled.
[2016-09-20 10:35:08] production.DEBUG: Local auth lookup complete
[2016-09-20 10:35:08] production.DEBUG: Binding user to LDAP.
[2016-09-20 10:35:08] production.DEBUG: Local user admin does not exist
[2016-09-20 10:35:08] production.DEBUG: User did not authenticate correctly against LDAP. No local user was created.
[2016-09-20 10:35:08] production.DEBUG: Authenticating user against database.
[2016-09-20 10:35:08] production.DEBUG: Local authentication failed.
[2016-09-20 10:38:25] production.DEBUG: LDAP is enabled.
[2016-09-20 10:38:25] production.DEBUG: Local auth lookup complete
[2016-09-20 10:38:25] production.DEBUG: Binding user to LDAP.
[2016-09-20 10:38:25] production.DEBUG: Local user zubair exists in database. Authenticating existing user against LDAP.
[2016-09-20 10:38:25] production.DEBUG: User zubair did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-20 10:38:25] production.DEBUG: Authenticating user against database.
[2016-09-20 12:10:04] production.DEBUG: LDAP is enabled.
[2016-09-20 12:10:04] production.DEBUG: Local auth lookup complete
[2016-09-20 12:10:05] production.DEBUG: Binding user to LDAP.
[2016-09-20 12:10:05] production.DEBUG: Local user zubair exists in database. Authenticating existing user against LDAP.
[2016-09-20 12:10:05] production.DEBUG: User zubair did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-20 12:10:05] production.DEBUG: Authenticating user against database.
[2016-09-20 12:10:05] production.DEBUG: Local authentication failed.
[2016-09-20 12:10:12] production.DEBUG: LDAP is enabled.
[2016-09-20 12:10:12] production.DEBUG: Local auth lookup complete
[2016-09-20 12:10:12] production.DEBUG: Binding user to LDAP.
[2016-09-20 12:10:12] production.DEBUG: Local user zubair exists in database. Authenticating existing user against LDAP.
[2016-09-20 12:10:12] production.DEBUG: User zubair did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-20 12:10:12] production.DEBUG: Authenticating user against database.
[2016-09-20 12:17:16] production.DEBUG: LDAP is enabled.
[2016-09-20 12:17:16] production.DEBUG: Local auth lookup complete
[2016-09-20 12:17:16] production.DEBUG: Binding user to LDAP.
[2016-09-20 12:17:16] production.DEBUG: Local user omer exists in database. Authenticating existing user against LDAP.
[2016-09-20 12:17:16] production.DEBUG: User omer did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-20 12:17:16] production.DEBUG: Authenticating user against database.
[2016-09-20 12:21:06] production.DEBUG: LDAP is enabled.
[2016-09-20 12:21:06] production.DEBUG: Local auth lookup complete
[2016-09-20 12:21:06] production.DEBUG: Binding user to LDAP.
[2016-09-20 12:21:06] production.DEBUG: Local user zubair does not exist
[2016-09-20 12:21:06] production.DEBUG: User did not authenticate correctly against LDAP. No local user was created.
[2016-09-20 12:21:06] production.DEBUG: Authenticating user against database.
[2016-09-20 12:21:06] production.DEBUG: Local authentication failed.

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

I need to see the actual error message from the 500 error you got during the LDAP test.

@omerzubair80
Copy link

see below here
ldap_10

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

That is your browser telling you there is a 500 error response from the server. I need to know what the server says the specific error is. I don't know how much clearer to make this.

@omerzubair80
Copy link

let me know where is the log file located in server will send you.

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

I have already pointed you to the docs and posted screenshots of the documentation.

The pasted text above is likely the right file, but there are no errors in there, just authentication debug messages, which don't throw a 500 error. That's got to be an incomplete paste.

Try this...

Type:

tail -f storage/logs/laravel.log

WHILE you hit the LDAP test button.

@omerzubair80
Copy link

Here below is the output

[2016-09-20 12:38:34] production.DEBUG: Binding user to LDAP.
[2016-09-20 12:38:34] production.DEBUG: Local user omer exists in database. Authenticating existing user against LDAP.
[2016-09-20 12:38:34] production.DEBUG: User omer did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-20 12:38:34] production.DEBUG: Authenticating user against database.
[2016-09-20 12:46:00] production.DEBUG: LDAP is enabled.
[2016-09-20 12:46:00] production.DEBUG: Local auth lookup complete
[2016-09-20 12:46:00] production.DEBUG: Binding user to LDAP.
[2016-09-20 12:46:00] production.DEBUG: Local user omer exists in database. Authenticating existing user against LDAP.
[2016-09-20 12:46:00] production.DEBUG: User omer did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-20 12:46:00] production.DEBUG: Authenticating user against database.

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

That's not the output from pressing the "Test LDAP" button. That's the output from actually trying to login.

@omerzubair80
Copy link

still not clear where the exact output to capture?

@omerzubair80
Copy link

Hi - awaiting for your reply on last post, let us know how to capture the output?

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

I have already explained it to you.

Type:

tail -f storage/logs/laravel.log

WHILE you hit the LDAP test button and watch what scrolls out onto the screen.

@omerzubair80
Copy link

Hi - here below is the output.

root@asset:/var/www/html/snipeit�[root@asset snipeit]#
root@asset:/var/www/html/snipeit�[root@asset snipeit]# tail -f storage/logs/laravel.log
[2016-09-20 12:46:00] production.DEBUG: Binding user to LDAP.
[2016-09-20 12:46:00] production.DEBUG: Local user omer exists in database. Authenticating existing user against LDAP.
[2016-09-20 12:46:00] production.DEBUG: User omer did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-20 12:46:00] production.DEBUG: Authenticating user against database.
[2016-09-20 15:39:37] production.DEBUG: LDAP is enabled.
[2016-09-20 15:39:37] production.DEBUG: Local auth lookup complete
[2016-09-20 15:39:37] production.DEBUG: Binding user to LDAP.
[2016-09-20 15:39:37] production.DEBUG: Local user omer exists in database. Authenticating existing user against LDAP.
[2016-09-20 15:39:37] production.DEBUG: User omer did not authenticate correctly against LDAP. Local user was not updated.
[2016-09-20 15:39:37] production.DEBUG: Authenticating user against database.

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

Once again, that's debugging output for a login attempt, not the test script.

You can keep pasting me the exact same thing over and over, and I'm just going to keep replying to you with the same info. For the Test LDAP script, we do not attempt a normal user auth, it's an admin auth, and that doesn't produce those debugging logs.

There are two different, unrelated LDAP functions in Snipe-IT. One is an admin LDAP authentication, which facilitates the LDAP sync in the People section, the other is a standard LDAP user login, which is how your LDAP users would authenticate against your installation of Snipe-IT. One has absolutely nothing to do with the other, and the LDAP text button triggers an admin auth, similar to that of the LDAP sync, which DOES NOT produce the log files you are (ceaselessly) showing me. No amount of pasting the same logs is going to change that.

Try this:

ldapsearch -H ldap://192.168.1.211:389 -x -b "YOUR-BIND-ADDRESS" -D "YOUR-AD-ADDRESS" -w "YOUR-LDAP-PASSWORD" "(&(cn=*))" -v

Just because you can ping a server doesn't mean it's listening on LDAP ports.

@omerzubair80
Copy link

You mean the search need to be run on Centos? it says -bash: ldapsearch: command not found

@snipe
Copy link
Owner

snipe commented Sep 20, 2016

Sounds like you're not running OpenLDAP. yum install openldap*

@omerzubair80
Copy link

Hi, still no luck. What i'm looking is when checkout asset to user, user names to be appear from my active directory. see below the screenshot & advise how to achieve it?
ldap_11

@omerzubair80
Copy link

Hi - awaiting for last post response prompt response will be highly appreciate.

@cjpit
Copy link

cjpit commented Jan 5, 2017

@snipe sorry just a heads up, when I have debug on, press the test button for ldap, it doesn't log anything to laravel.log fyi. (latest docker build).

anything else we can try? ( I have mine working with a full admin user, but I''d like to use a separate ldapquery user that I use for other ad auth stuff, for jira and the likes)

@kgpandey
Copy link

@omerzubair80 have you fix this issue?

@afzalmomin
Copy link

how to install ldap
Error:-It doesn't look like the LDAP extension is installed or enabled on this server. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants