Hi,
suppose that everything is OK with mapping LDAP groups to custom made roles (as I can conclude from this issue). Then I need help with making it work with Active Directory.
First about syntax:
function ldapgroups_role_mappings() {
return array(
// LDAP group => Drupal role
// Make sure the last group->role mapping does NOT have a trailing comma (,).
//'cn=admin,ou=Group,dc=example,dc=com' => 'IT'
'CN=admin,OU=Group first,DC=example,DC=local' => 'G1',
'CN=admin,OU=Group second,DC=example,DC=local' => 'G2'
);
}Is syntax above correct? Another thing is values:
- I replaced 'example' value of our company domain name, 'local' stays because this is intranet LDAP
- I replaced name of AD OU/groups with real ones which are containing one (or more) word
- But what is confusing is cn=admin. I can't figure what is this and do I need it? I tried without this first CN attribute but there is no difference: there is no mapping of user roles to custom ones specified in ldapgroups.conf.php file.
If somebody is familiar with name mapping of LDAP groups, or better with AD organizational units, please help. Any feedback is appreciated.
Tnx in advance.
P.S.
What I want is to filter and map existing groups in AD, but first I need to solve mapping issue before enabling filtering.
With
By Bryce Cogswell and Mark Russinovich">Active Directory Explorer I have access to our local AD so I can check everything I need to...but I don't know what or where exactly to search.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ldap-integration-issue.txt | 2.65 KB | izkreny |
Comments
Comment #1
izkreny commentedOh, silly me, I messed it up all.
So, with some little knowledge/research about LDAP and after reading Advanced configuration guide my final question is:
What exactly LDAP group is meaning? DN for LDAP group?
In examples from Advanced configuration guide,
I can assume that there is OU 'Groups' in LDAP hierarchy. Beneath that OU is laying CN definitions of user groups in that specific LDAP. So LDAP group is DN for that group, right?
In my example (in Active Directory), DN for CN of one group is:
CN=Small department,OU=Small department,OU=Big department,OU=City,DC=example,DC=localAnd when I put it in ldapgroups.conf.php file it looks like this:
And it is not working. :(
I'm starting to believing that this is a bug, another example that I tried with is (this AD group):
CN=Users,DC=example,DC=local, according to hierarchy in my AD.Comment #2
izkreny commentedHere I come again, and this is last time I hope so, at least in this issue! ;)
Thanks to (unresolved) Active Directory groups within groups within groups... support request, I found out where I was making mistake, and I'm posting it as patch to LDAP Integration documentation (also changed Category to task and component to Documentation).
Configuration of ldapgroups module documentation node (just last sentence):
Use this option if the user object contains an attribute that represents the group the user belongs to. This is most commonly applicable to Active Directory environment. The attribute of the user object that holds the group DN is
memberOf.Also it is necessary to use this option if you are using Active Directory and want to map/filter AD groups to Drupal roles.
And here is patch to:
LDAP Integration Advanced configuration documentation node (it need to be inserted just above "Uncomment the function
ldapgroups_roles_filter." unordered list item):If you are using Active Directory and it is structured similar to this:
then you need to edit
modules/ldap_integration/ldapgroups.conf.phpfile and specify your AD groups and their role names like presented in example below:This part of code is from
ldapgroups.conf.phpfile from 6.x version of LDAP integration module, but syntax for specifying the AD group is same as in 5.x version.Another important thing is to configure LDAP Groups (Administer >> Site Configuration >> LDAP Groups) by (AD) attribute of the user object that holds the group DN (which is
memberOf).>> End of documentation patch <<
I can also comment these documentation nodes if there is nobody to update them.
After all, it remains way mapping is not working when you configure ldapgroups with Group is specified in user's DN option in 'Group by DN' section. Maybe Active Directory is supposed to have groups stored only in (memberOf) user entries - then this would be OK behavior. I will try to find out this from our LAN admins and report it back in Active Directory groups within groups within groups... support request.
Cheers.
P.S.
I attached HTML code of my contribution to LDAP integration documentation, to make updating easier.
Comment #3
claar commentedIf I understand your suggestion, you're saying that instead of this module supporting nested groups, people should use the mapping system to work-around the missing feature?
I agree with http://drupal.org/node/178345#comment-1057292 -- this is unworkable in any reasonably sized LDAP implementation, as you'd have to update these role mappings every time AD changes, which may be frequently.
Comment #4
johnbarclay commentedthis documentation is for drupal 5 ldap integration so I'm closing the issue. Support for nested groups issue is #178345: Support nested groups