You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Galen Seitz <ga...@seitzassoc.com> on 2008/04/25 23:20:35 UTC

[users@httpd] auth based on uri

Is it possible to do authorization based on a pattern in the uri?  I'd like to
be able to create a single container that would control access to various
directories where the directory name is the same as an auth group name.  For
example:

<DirectoryMatch /share/([^/]+) >
    ...
    Require group \1
</DirectoryMatch>


Instead of:

<Directory /share/proj1 >
    ...
    Require group proj1
</Directory>

<Directory /share/proj2 >
    ...
    Require group proj2
</Directory>

<Directory /share/proj3 >
    ...
    Require group proj3
</Directory>


If there is a way to do this, I would ultimately be doing ldap auth.

Suggestions?

thanks,
Galen Seitz






---------------------------------------------------------------------
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


Re: [users@httpd] auth based on uri

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 25 Apr 2008 21:20:35 +0000 (UTC)
Galen Seitz <ga...@seitzassoc.com> wrote:

> Is it possible to do authorization based on a pattern in the uri?
> I'd like to be able to create a single container that would control
> access to various directories where the directory name is the same as
> an auth group name.  For example:
> 
> <DirectoryMatch /share/([^/]+) >
>     ...
>     Require group \1
> </DirectoryMatch>

No.

With Apache 2.2 or lower, the best you can do is use
mod_rewrite to map from / or /group/ or (your choice)
to an appropriate directory based on REMOTE_USER
with a "Require valid-user".

In future versions, we hope to offer better options.

> <Directory /share/proj1 >
>     ...
>     Require group proj1
> </Directory>
> 
> <Directory /share/proj2 >
>     ...
>     Require group proj2
> </Directory>

You can also use mod_macro to take the pain out of that.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
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