# Ldap backend doesn't authenticate users

**URL:** <https://help.nextcloud.com/t/ldap-backend-doesnt-authenticate-users/195683>\
**Category:** ℹ️ Support\
**Tags:** nc29, ldap\
**Created:** [June 20, 2024, 6:13pm UTC](https://help.nextcloud.com/t/ldap-backend-doesnt-authenticate-users/195683 "2024-06-20T18:13:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arturo\_Duran\_Domingu](https://help.nextcloud.com/user_avatar/help.nextcloud.com/arturo_duran_domingu/32/55757_2.png) [@Arturo\_Duran\_Domingu](https://help.nextcloud.com/u/Arturo_Duran_Domingu)\
**Post date:** [June 20, 2024, 6:13pm UTC](https://help.nextcloud.com/t/ldap-backend-doesnt-authenticate-users/195683/1 "2024-06-20T18:13:06Z")

</div>

Hi,

I’m prepairing a nextcloud community version for a workgroup. We already use an openldap for managing authoritation of services. So I’ve integrated nextcloud with openldap using app 'LDAP user and group backend '.  
Instance details:  
Nextcloud version : 29.0.2.2  
Operating system and version: Debian bookworm 12.5  
nginx version: 1.22.1  
PHP version: 8.2.18  
'LDAP user and group backend ’ version: 1.20.0

I’ve configured correctly the app user\_ldap and users have been provisioned in nextcloud correctly. But when I’ve tested users can’t access nextcloud with message ‘incorrect user or credential’.

I’m debugging app code and I’ve solved the problem adding the Interface ICheckPasswordBackend for class User\_LDAP in the file apps/user\_ldap/lib/User\_LDAP.php  
This is my patch:

line 57 :php

```auto
//_>
use OCP\User\Backend\ICheckPasswordBackend;
//_>

class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, IUserLDAP, ICountUsersBackend, ICountMappedUsersBackend, IProvideEnabledStateBackend,
//_>
ICheckPasswordBackend
//_>

```

This class already implements the methods specified in the interface ICheckPasswordBackend so simply adding in the definition everything is ok.  
When I add this patch the ldap backend begins to be used to authenticate users.  
I’m really grateful for the great job that have been carried out by nextcloud team. I don’t find a similar question in your knowledgebase, so I hope this contribution would be useful.

Bye

---

<div class="post-metadata">

**Author:** ![ernolf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ernolf/32/77874_2.png) [@ernolf](https://help.nextcloud.com/u/ernolf)\
**Post date:** [June 20, 2024, 8:23pm UTC](https://help.nextcloud.com/t/ldap-backend-doesnt-authenticate-users/195683/2 "2024-06-20T20:23:52Z")

</div>

Hi @Arturo_Duran_Domingu

> [@Arturo\_Duran\_Domingu](#):
>
> I’ve configured correctly the app user\_ldap and users have been provisioned in nextcloud correctly. But when I’ve tested users can’t access nextcloud with message ‘incorrect user or credential’.
> 
> I’m debugging app code and I’ve solved the problem adding the Interface ICheckPasswordBackend for class User\_LDAP in the file apps/user\_ldap/lib/User\_LDAP.php  
> This is my patch:

Maybe you can post your findings with your patch here:

> **[Issues · nextcloud/server](https://github.com/nextcloud/server/issues)**
>
> ☁️ Nextcloud server, a safe home for all your data - Issues · nextcloud/server

so the devs of the app will/can take a look over it.

* * *

Much and good luck,  
ernolf

---

<div class="post-metadata">

**Author:** ![Arturo\_Duran\_Domingu](https://help.nextcloud.com/user_avatar/help.nextcloud.com/arturo_duran_domingu/32/55757_2.png) [@Arturo\_Duran\_Domingu](https://help.nextcloud.com/u/Arturo_Duran_Domingu)\
**Post date:** [June 21, 2024, 5:01am UTC](https://help.nextcloud.com/t/ldap-backend-doesnt-authenticate-users/195683/3 "2024-06-21T05:01:10Z")

</div>

This is the patch

56a57,59

> //_\>  
> use OCP\User\Backend\ICheckPasswordBackend;  
> //_\>  
> 58c61,66  
> \< class User\_LDAP extends BackendUtility implements IUserBackend, UserInterface, IUserLDAP, ICountUsersBackend, ICountMappedUsersBackend, IProvideEnabledStateBackend {

* * *

> class User\_LDAP extends BackendUtility implements IUserBackend, UserInterface, IUserLDAP, ICountUsersBackend, ICountMappedUsersBackend, IProvideEnabledStateBackend,  
> //_\>  
> ICheckPasswordBackend  
> //_\>
> 
> {

Best regards,  
Arturo

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [January 16, 2025, 8:12am UTC](https://help.nextcloud.com/t/ldap-backend-doesnt-authenticate-users/195683/4 "2025-01-16T08:12:56Z")

</div>


