Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7 Preview Release
-
Fix Version/s: 1.9.2
-
Component/s: Zend_Auth_Adapter_Ldap
-
Labels:None
Description
When using Zend_Auth_Adapter_Ldap, there is missing an additional check if a user is member of a specific group.
I found this in an old proposal:
http://framework.zend.com/wiki/display/ZFPROP/Zend_Auth_Adapter_Ldap?showComments=false
'group_dn' : the DN of a group the authenticated user should be member of. If the user is authenticated against the LDAP, but is not member of the specified group, the authentication will fail (not implemented yet).
This feature is also available in PEAR_Auth, and I think many people out there would like to use such a feature, because mostly not everybody in a ldap-directory should be able to login, but specific groups (like e.g. departments in a company, or just admins and not "normal users").
Here are my derived classes where I added the descripted feature.
You can use them to add the functionality to Zend_Ldap and Zend_Auth_Adapter_Ldap.
I'm not a specialist in Zend-Coding-Standards, but it will help you.
I used the following config to use the new feature:
ldap.server1.host = ldap.domain.de
ldap.server1.useSsl = false
ldap.server1.accountDomainName = blub.domain.com
ldap.server1.accountDomainNameShort = blub
ldap.server1.accountCanonicalForm = 3
ldap.server1.accountFilterFormat = "(&(objectClass=user)(sAMAccountName=%s))"
ldap.server1.username = "cn=ldap,ou=myCompany,DC=blub,DC=domain,DC=com"
ldap.server1.password = mypwd
ldap.server1.baseDn = "DC=blub,DC=domain,DC=com"
ldap.server1.bindRequiresDn = true
ldap.server1.groups.1 = "Group 1 Admins"
ldap.server1.groups.2 = "Group 2 Germany Account Manager"
ldap.server1.groupAttr = "samAccountName"
ldap.server1.groupFilter = "(objectClass=group)"
ldap.server1.memberAttr = "member"