It is possible to use a portion of the request URI as an input into mod_authnz_ldap's Require ldap-group
directive?
I'm trying to dynamically check access to a bunch of different project directories, all under http://testserver.com/projects/, such that a user accessing /projects/abc
would be checked for membership in cn=abc,ou=groups,dc=test
. Ideally I'd like to do this without creating a separate Location directive for each project, since there could well be hundreds of them.
I have come up with this, which illustrates the general concept, but which doesn't work (project_name doesn't retrive the actual variable contents):
<Location /projects>
SetEnvIf Request_URI "/projects/([-a-z0-9A-Z_]+)/" project_name=$1
AuthType Basic
AuthBasicProvider ldap
AuthName "Restricted Resource - SVN (LDAP)"
AuthLDAPURL "ldap://127.0.0.1:389/dc=test?uid"
AuthLDAPGroupAttributeIsDN off
AuthLDAPGroupAttribute memberUid
Require ldap-group cn=%{project_name},ou=groups,dc=test
</Location>
Help?