httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Anderson <b...@dsource.org>
Subject [users@httpd] Group Authz with an ENV variable
Date Thu, 06 Jan 2005 07:43:46 GMT
I'm wondering if it's possible to do the following.  I'd like to require group 
based on the Request_URI.  For example:

request:  http://example.com/projects/aaa/login

authz: require group aaa

My httpd.conf file attempt #1:

<LocationMatch /projects/[[:alnum:]]+/login>

  SetEnvIf Request_URI "^/projects/(.*)$" grp=$1

  AuthType Basic
  AuthName "auth"
  AuthUserFile  /var/www/passwd
  AuthGroupFile /var/www/groups
  Require group env=grp

</LocationMatch>

This is like trying to get SetEnvIf to act like mod_rewrite with the regex () 
and the $1.  Not sure that's possible.

My httpd.conf file attempt #2:

<LocationMatch /projects/[[:alnum:]]+/login>

  RewriteEngine On
  RewriteRule /projects/(.*)/(.*) /projects/$1/$2 [E=grp:$1]

  AuthType Basic
  AuthName "auth"
  AuthUserFile  /var/www/passwd
  AuthGroupFile /var/www/groups
  Require group %{ENV:grp}
#  or
#  Require group env=grp
</LocationMatch>


Thanks for any help you can provide.

Cheers,
Brad



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message