snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Unable to Login using AD account

Open siekee opened this issue 9 years ago • 33 comments

My LDAP connection test is successful but when i tried login using AD account, i am getting error: the username or password is incorrect. I am unable to find the location of the log file even to start troubleshooting. Please Help

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


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running v3.6.2 build 10 (g927a12f)
  • What OS and web server you're running Snipe-IT on CentOS 7
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) install.sh

siekee avatar Dec 20 '16 00:12 siekee

https://snipe-it.readme.io/docs/getting-help#step-3-check-your-app-and-server-logs

snipe avatar Dec 20 '16 01:12 snipe

Thank you for your immediate respond. The error i get from the laravel.log is

production.Error: there was an error authenticating the LDAP user: could not find user in LDAP directory

siekee avatar Dec 20 '16 01:12 siekee

Your LDAP filter is likely wrong then. It's able to connect, it just can't find the user within your directory using the filter you provided.

snipe avatar Dec 20 '16 01:12 snipe

Not sure what is the right filter that i shall be using. I tried different filter and some listed in the discussion board by other user, none working for me

siekee avatar Dec 20 '16 02:12 siekee

Can you post your settings?

therealjoshuad avatar Dec 20 '16 02:12 therealjoshuad

Please see the documentation here: https://snipe-it-manual.readme.io/docs/ldap

snipe avatar Dec 20 '16 02:12 snipe

screen shot 2016-12-20 at 12 00 54 pm

siekee avatar Dec 20 '16 04:12 siekee

Hi @siekee

You look to be using some fields names that are used for LDAP but different to AD field names. "uid" for instance is not used in AD by default.

Generally for AD you should probably have these, the LDAP filter is a suggestion, perhaps go as per the doco: LDAP Filter: &((objectcategory=person)(objectclass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)) Username Field: samaccountname LDAP Authentication query: samaccountname=

For example this is my LDAP Filter: &(!(sAMAccountName=svc*))(!(sAMAccountName=test*))(mail=*)(objectcategory=person)(objectclass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)) This ensures service and test accounts are excluded and user accounts without an email address are excluded.

aglasson avatar Dec 20 '16 10:12 aglasson

Thanks for the advise. I had change the LDAP filter, username field and auth query to as shown above but still getting the same error

siekee avatar Dec 21 '16 02:12 siekee

Is that the correct structure of your OU? Do you have an OU called "am" within the OU "Staff"? With all the users you want available in Snipe within the "am" OU?

aglasson avatar Dec 21 '16 05:12 aglasson

i have the OU "am" and i can sync the user over to snipe-it without any issue, just having issue login the user into snipe-it

siekee avatar Dec 21 '16 06:12 siekee

Hmm. Could be LDAP Filter related maybe. I think I've exhausted my expertise now.

aglasson avatar Dec 21 '16 07:12 aglasson

Make sure the Username Field is set to samaccountname, and that the LDAP auth query is set to sAMAccountName= as shown in the guide.

image

therealjoshuad avatar Dec 21 '16 07:12 therealjoshuad

Thanks for your reply. I changed the LDAP filter to &(cn=*) and also the username field and auth query to what you suggest but still not able to login too

siekee avatar Dec 21 '16 08:12 siekee

And you've checked the box on the LDAP settings that says this is an Active Directory domain?

Sent from my iPhone

On Dec 21, 2016, at 2:27 AM, siekee [email protected] wrote:

Thanks for your reply. I changed the LDAP filter to &(cn=*) and also the username field and auth query to what you suggest but still not able to login too

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

therealjoshuad avatar Dec 21 '16 08:12 therealjoshuad

This is an Active Directory server is not ticked. I ticked it and it make no different, still not able to login

siekee avatar Dec 21 '16 08:12 siekee

how about set the LDAP filter to simpler query such as:

objectCategory=user

does it work?

denihanca avatar Dec 21 '16 11:12 denihanca

@denihanca same, not working

siekee avatar Dec 21 '16 11:12 siekee

We got exact same problem.. I found that our AD domain name was missing. After adding that I was able to log in with AD account. It is strange because I was able to sync all my AD accounts without any error messages. asset manager

ittugi avatar Dec 21 '16 11:12 ittugi

@ittugi Glad that it is working for you. That particular field is not empty for me

siekee avatar Dec 21 '16 12:12 siekee