I'm using mod_authn_alias and mod_authnz_ldap against an Apache/2.2.14 (Ubuntu) and I'm trying to configure ldap authentication against multiple domains.
My config is:
<AuthnProviderAlias ldap alpha>
AuthLDAPBindDN "CN=admin-alpha,CN=Users,DC=alpha,DC=local"
AuthLDAPBindPassword "xxx"
AuthLDAPURL "ldap://dc01.alpha.local/CN=Users,DC=alpha,DC=local?sAMAccountName?sub?(objectClass=*)"
</AuthnProviderAlias>
<AuthnProviderAlias ldap beta>
AuthLDAPBindDN "CN=admin-beta,CN=Users,DC=beta,DC=local"
AuthLDAPBindPassword "xxx"
AuthLDAPURL "ldap://dc01.beta.local/CN=Users,DC=test,DC=local?sAMAccountName?sub?(objectClass=*)"
</AuthnProviderAlias>
<Directory "/usr/local/nagios/addons/pnp/share">
AllowOverride None
Order allow,deny
Allow from all
AuthName "Pnp Access"
AuthType Basic
AuthBasicProvider alpha beta
AuthzLDAPAuthoritative off
#Important, otherwise "(9)Bad file descriptor: Could not open password file: (null)"
AuthUserFile /dev/null
#only members of this group can log in
Require ldap-group CN=grp_nagiosadmins,DC=beta,DC=local
Require ldap-group CN=grp_nagiosadmins,DC=alpha,DC=local
...
</Directory>
So if the user can't be authenticated to the alpha domain, it should failover to domain beta. However, no user from either domain can be authenticated with this config.
When I try to log in:
[Fri Mar 07 16:13:35 2014] [error] [client 10.100.13.30] access to /pnp failed, reason: require directives present and no Authoritative handler.
[Fri Mar 07 16:13:38 2014] [error] [client 10.100.13.30] access to /pnp failed, reason: require directives present and no Authoritative handler.
Why not put all my users in one domain? That's a long story and it ultimately wasn't my decision.
How do I configure this correctly?