#java #spring-security #ldap
#java #spring-безопасность #ldap
Вопрос:
Spring Security не находит ролей.
Конфигурация:
<security:authentication-manager>
<security:ldap-authentication-provider
user-search-filter="(cn={0})"
user-search-base="OU=users,ou=gk,dc=corp,dc=mycompany,dc=com"
group-search-filter="(amp;amp;(objectclass=group)(member={0}))"
group-search-base="OU=groups,ou=gk,dc=corp,dc=mycompany,dc=com">
</security:ldap-authentication-provider>
</security:authentication-manager>
ЖУРНАЛ:
Searching for roles for user 'terehin_gv', DN = 'cn=terehin_gv,ou=Users,ou=gk,dc=corp,dc=mycompany,dc=com', with filter (amp;(objectclass=group)(member={0})) in search base 'OU=Groups,ou=gk,dc=corp,dc=mycompany,dc=com' |org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
|[2016.10.12 09:37:16.277]|DEBUG|http-8443-2 |s.l.SpringSecurityLdapTemplate| Using filter: (amp;(objectclass=group)(member=cn=terehin_gv,ou=Users,ou=gk,dc=corp,dc=mycompany,dc=com)) |org.springframework.security.ldap.SpringSecurityLdapTemplate
|[2016.10.12 09:37:16.277]|DEBUG|http-8443-2 |efaultLdapAuthoritiesPopulator| Roles from search: [] |org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
В ApacheDirectoryStudio такого запроса выполняется и отображается список групп.