Configure the LDAP mail authority regulator as shown below and it will work with nested groups:
<bean id="ldapAuthoritiesPopulator" class="org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator"> <constructor-arg ref="ldapContextSource" /> <constructor-arg value="OU=Resource,OU=Security Groups,OU=Administrative Area" /> <property name="groupRoleAttribute" value="cn" /> <property name="rolePrefix" value="" /> <property name="convertToUpperCase" value="false"/> <property name="searchSubtree" value="true" /> <property name="groupSearchFilter" value="(&(&(objectClass=group)(objectCategory=CN=Group,CN=Schema,CN=Configuration,DC=company,DC=local))(&(cn=RG-TRADE*)(member:1.2.840.113556.1.4.1941:={0})))" /> </bean>
The value of groupSearchFilter means:
objectClass=[group object class] AND objectCategory=[group object category] AND cn_name_of_group=RG-TRADE* AND member:here_magic_for_nested_groups=[user full dn]
source share