can sync users from nested AD group but authentication fails

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 34.0.4.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 13
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.68
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • 8.4.25
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • with first nested group
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

I’m using nested AD groups for authentication. All users from parent group and nested child group have been imported to nextcloud successfully. Users in parent group can login and authenticate with their AD credentials. Users from nested group can be seen in Nextcloud with names and details. But users from the nested group cannot login.

The global security groups are organized like this:

Top group (parent): nc_users
Contains a few users. All these users can authenticate. Nextcloud is working fine.

Nested group within nc_users: nc_group1

nc_group1 contains 20 users. All are visible in accounts view with names and details. LDAP sync seems sucessful. LDAP configuration checks are all green. User counts correct.

None of the nested users can authenticate.

I followd the documentation for nested AD groups. But something seems to be missing or wrong.

This is my LDAP configuration:

±------------------------------±----------------------------------------------------------------------------------------------------------------------------------------------+
| Configuration | s01 |
±------------------------------±----------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport | 1 |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAdminGroup | |
| ldapAgentName | ad\yx123 |
| ldapAgentPassword | *** |
| ldapAttributeAddress | |
| ldapAttributeAnniversaryDate | |
| ldapAttributeBiography | |
| ldapAttributeBirthDate | |
| ldapAttributeFediverse | |
| ldapAttributeHeadline | |
| ldapAttributeOrganisation | |
| ldapAttributePhone | |
| ldapAttributePronouns | |
| ldapAttributeRole | |
| ldapAttributeTwitter | |
| ldapAttributeWebsite | |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackgroundHost | |
| ldapBackgroundPort | |
| ldapBackupHost | |
| ldapBackupPort | 389 |
| ldapBase | dc=ad,dc=my-domain,dc=org |
| ldapBaseGroups | dc=ad,dc=my-domain,dc=org |
| ldapBaseUsers | dc=ad,dc=my-domain,dc=org |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapConnectionTimeout | 15 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | |
| ldapExtStorageHomeAttribute | |
| ldapGidNumber | gidnumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(|(objectclass=group))(|(cn=nc_users)(cn=nc_group1))) |
| ldapGroupFilterGroups | nc_users;nc_group1 |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | group |
| ldapGroupMemberAssocAttr | member |
| ldapHost | ad.my-domain.de |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(|(|(memberof=CN=nc_users,OU=Groups,OU=section1,OU=Dept,DC=ad,DC=my-domain,DC=de)(primaryGroupID=2890377)))(samaccountname=%uid)) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 0 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapMatchingRuleInChainState | available |
| ldapNestedGroups | 1 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | |
| ldapQuotaDefault | 20 GB |
| ldapTLS | |
| ldapUserAvatarRule | default |
| ldapUserDisplayName | displayName |
| ldapUserDisplayName2 | |
| ldapUserFilter | (|(|(memberof:1.2.840.113556.1.4.1941:=CN=nc_users,OU=Groups,OU=section1,OU=Dept,DC=ad,DC=my-domain,DC=de)(primaryGroupID=2890377))) |
| ldapUserFilterGroups | nc_users |
| ldapUserFilterMode | 1 |
| ldapUserFilterObjectclass | |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| markRemnantsAsDisabled | 1 |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
±------------------------------±----------------------------------------------------------------------------------------------------------------------------------------------+

Nextcloud

Nextcloud works as expected for users in the top group.

Web Browser

Issue is unrelated to browsers and client OS.

TIA

Michael

Looks like maybe you made the necessary change to the User filter but not the Login filter:

See User listing and login per nested groups.

Thank you very much for pointing me to the solution!
Yes, I forgot to adjust ldapLoginFilter.
It’s in the manual, but I didn’t notice the words in brackets.
“Also the User (and Login) filter need to be changed.”
Totally makes sense :slight_smile: