Skip to content

LDAP Authentication NextCloud

elurex edited this page Mar 25, 2019 · 1 revision

Please note that for nextcloud, it will automatically populates user and groups from ldap. You must test and verify every step.

go to +APP enable LDAP user and group backend 

go to Settings -> LDAP / AD integration

Server

Host: <ldap server ip>
Port: 389
User DN: cn=admin,dc=exmaple,dc=com
Password: <ldap password>
One Base DN per line: dc=exmaple,dc=com
Manually enter LDAP filters: unchecked/No

User

Edit LDAP Query: (&(objectclass=inetOrgPerson)(cn=*))

Login Attributes

LDAP /AD Username: checked/Yes
LDAP /AD Email Address: unchecked/No
Other Attributes: select nothing
Edit LDAP Query -> LDAP Filter: (&(objectClass=inetOrgPerson)(cn=%uid))

Groups

Edit LDAP Query -> LDAP Filter: 
(&(|(objectclass=groupOfNames))(!(cn=Domain Controllers))(!(cn=Domain Computers))(!(cn=Domain Guests))(!(cn=Domain Users)))

Advance

#Directory Settings
User Display Name Field: gecos
2nd User Display Name Field: cn
Base User Tree: ou=Users,dc=example,dc=com
Group Display Name Filed: cn
Base Group Tree: ou=Groups,dc=example,dc=com
Group Search Attributes: <blank>
Group-Member association: member
Dyanmic Group Member URL: <blank>
Nested Groups: unchecked/No
Paging chunksize: 500
Enable LDAP password changes per user: checked/Yes ***
Default password policy DN: cn=ppolicy,ou=policies,dc=example,dc=com

#Special Attributes
Email Field: mail

**  Make sure you have enabled Openldap password policy overlay, so that clear text password will automatically hashed with ssha

ppolicy_module.ldif

dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModuleLoad: ppolicy.la
olcModulePath: /usr/lib/ldap

ppolicy-overlay.ldif

dn: olcOverlay=ppolicy,olcDatabase={1}mdb,cn=config
objectClass: olcPPolicyConfig
olcOverlay: ppolicy
olcPPolicyDefault: cn=ppolicy,ou=policies,dc=example,dc=com
olcPPolicyUseLockout: FALSE
olcPPolicyHashCleartext: TRUE

ldapadd -Y EXTERNAL -H ldapi:/// -f ppolicy_module.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f ppolicy-overlay.ldif

Clone this wiki locally