You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by TJB <tj...@gmail.com> on 2007/05/11 03:23:52 UTC

[users@httpd] 2.2.4 Require file-group seems to forget user authentication

Hello List:

My goal is to base web access control on the underlying Unix file system
group access. I'm using:

- AuthzUnixgroup (Third-party module which effectively replaces AuthGroupFile
  with /etc/group.  http://www.unixpapa.com/mod_authz_unixgroup/)
- Apache's "Require file-group" mechanism (mod_authz_owner)

We experience two prohibitively annoying side-effects of this, and I need
help with #2:

1) Every request for a missing file results in a request for
reauthentication. To solve this, I've added rewrite rules which check for
file existence. If a requested file doesn't exist, it rewrites the
request to an informative php script.  This works well.

2) A request for an existing file to which the authenticated user is
not authorized results in the desired request for reauthentication and
access denial.  However, when the user then returns to a file to which
s/he is authorized, s/he is again forced to reauth.  It's as if the
user's login is forgotten after every step out-of-bounds.

Is this the expected behavior for "Require file-group"?  If so, can
anyone recommend a friendlier work-around?

--

We're at: Solaris8, apache-2.2.4, SSL is enabled.

#############################################################################
<Directory /web/htdocs/TJB_TEST >
AllowOverride None
order deny,allow
deny from all
allow from .example.com
Options SymLinksIfOwnerMatch IncludesNOEXEC Indexes

DirectoryIndex /DirectoryIndexer.php

AuthName "TJB_TEST Access Controls Test"
AuthType Basic
AuthBasicProvider file
AuthUserFile /web/conf/Password.cfg

AuthzOwnerAuthoritative on
AuthzUnixgroup on

Require file-group
Satisfy all
</directory>
#############################################################################


Thanks!
--Tom

---------------------------------------------------------------------
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] 2.2.4 Require file-group seems to forget user authentication

Posted by Joshua Slive <jo...@slive.ca>.
On 5/10/07, TJB <tj...@gmail.com> wrote:

> 1) Every request for a missing file results in a request for
> reauthentication. To solve this, I've added rewrite rules which check for
> file existence. If a requested file doesn't exist, it rewrites the
> request to an informative php script.  This works well.

You could also try using the ErrorDocument 404 directive to point to
someplace non-authenticated. But this does appear to be a miss-feature
in the mod_authz_unixgroup module. It obviously doesn't know how to
determine the correct authorization info if the file doesn't exist
(since it can't use the file's group info). It should have some
fallback.

>
> 2) A request for an existing file to which the authenticated user is
> not authorized results in the desired request for reauthentication and
> access denial.  However, when the user then returns to a file to which
> s/he is authorized, s/he is again forced to reauth.  It's as if the
> user's login is forgotten after every step out-of-bounds.
>
> Is this the expected behavior for "Require file-group"?  If so, can
> anyone recommend a friendlier work-around?

This does seem like an inherent problem of file-group. The problem is
that you have areas with different authorization requirements, but
they are all under the same "realm" (AuthName). The browser uses the
realm to determine when it should cache and resend credentials. When
you hit an unauthorized file, the browser will receive the 401
response and flush the credentials for that realm. I don't see any
easy way around that.

Joshua.

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