Skip to main content
Solved

ldap Authentication failed

  • September 1, 2023
  • 8 replies
  • 992 views

Forum|alt.badge.img+3

Hi guys,

 

Since a couple of days, ldap access doesn’t work anymore.

 

login.log reports “Authentication failed for 'xxx' : invalid credentials”

ldap.log reports “LDAP AUTH - Error : No DN for xxx”

 

ldap user import still is working properly 

 

Any help would be appreciated.

 

Thanks

 

J.

Best answer by lpinsivy

Are you sure that the “Login attribute” in the LDAP server definition is correct?

 

8 replies

lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • 1121 replies
  • September 4, 2023

Hi @Jul3s ,

Can you check in in database, information are ok using following SQL request:

SELECT contact_id, contact_alias, contact_auth_type, ar_id, contact_ldap_dn FROM contact;

 

ar_id is the ID of the LDAP server (from auth_ressource_host table) where Centreon use to find the user during the first import. ID can change if Centreon don’t find anymore this user on the LDAP server and find it on another one.


Forum|alt.badge.img+3
  • Author
  • Steward *
  • 7 replies
  • September 5, 2023

Salut Laurent :D

 

Thanks for your help.

 

contacts seems right in contact tables, here is an example :

|         32 | xxx                  | ldap              |     1 | CN=xxx xxx,OU=DSI,OU=Users,OU=xxxx,OU=xxx,OU=xxx,DC=xxxx,DC=lxxx                |

 

 

select * from auth_ressource_host;

+--------------+-------------------+--------------+-----------+---------+---------+------------+

| ldap_host_id | auth_ressource_id | host_address | host_port | use_ssl | use_tls | host_order |

+--------------+-------------------+--------------+-----------+---------+---------+------------+

|            5 |                 1 |              |         0 |       0 |       0 |          1 |

+--------------+-------------------+--------------+-----------+---------+---------+-----------∓

 

 

Cordialement,

 

J.


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • 1121 replies
  • September 5, 2023

Looks good for your contact.

 

Did you change value for second request or host_address and host_port are incorrect?


Forum|alt.badge.img+3
  • Author
  • Steward *
  • 7 replies
  • September 5, 2023

Nope, the result of the second request has not been changed.

Same values on tables of centreon databases.


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • 1121 replies
  • September 6, 2023

Hi @Jul3s , so you need to correct IP and port address of your LDAP server from “Administration  >  Parameters  >  LDAP” menu.

Regards,


Forum|alt.badge.img+3
  • Author
  • Steward *
  • 7 replies
  • September 6, 2023

Hi there,

Thx for that lead.

I was using the “Use service DNS” option.

I disabled the option in order to add the ldap servers.

select * from auth_ressource_host;
+--------------+-------------------+--------------+-----------+---------+---------+------------+
| ldap_host_id | auth_ressource_id | host_address | host_port | use_ssl | use_tls | host_order |
+--------------+-------------------+--------------+-----------+---------+---------+------------+
|            6 |                 1 | 172.24.xx.xx |       389 |       0 |       0 |          1 |
|            7 |                 1 | 172.24.xx.xx |       389 |       0 |       0 |          2 |
+--------------+-------------------+--------------+-----------+---------+---------+-----------∓

 

ar_id is still 1 for ldap users

 

But I stil got that “No DN” error 

 

The strange thing is that I still can do ldap import of user, meaning that centreon is able to communicate with ldap hosts, right ?

 

Regards,

J.


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • 1121 replies
  • Answer
  • September 7, 2023

Are you sure that the “Login attribute” in the LDAP server definition is correct?

 


Forum|alt.badge.img+3
  • Author
  • Steward *
  • 7 replies
  • September 7, 2023

Login attribure is samaccountname and matching with ad login.

While writing this lines and checking ldap paramters, you helped me find my problem…

In fact, I changed the user filter parameter, thinking that it only afftects the “ldap import filter” (Changed from samaccountname to CN for helping me import users as uid is different of the name).

Bringing back user filter to “(&(samaccountname=%s)(objectClass=user)(samAccountType=xxx)) solved my problem.

 

Many thanks for the time you spent to help me with this,