2017-06-05 42 views
0


我創建與它在LDAP組指定的用戶的特殊權限的應用程序,我登錄使用Spring Security的,但我不知道如何檢查用戶組。

目標是顯示包含數據的所有ldap用戶表,並且如果有人屬於ldap中的某個組,它還會顯示用於更改該數據的按鈕。

那麼如何檢查屬於LDAP用戶的組?春天LDAP,檢查用戶的成員指定的組

問候,Rafał!

回答

0

使用此驗證的用戶身份驗證在特定組

FilterBasedLdapUserSearch search = new FilterBasedLdapUserSearch(
    "OU=users,DC=mycompany,DC=com", 
    "(&(objectCategory=user)(objectClass=person)(sAMAccountName={0})" + 
    "(memberof:=CN=entergroup,OU=Users,DC=mycompany,DC=com)" +")", contextsource); 

希望這會有所幫助。