Bug 45674 - Allow to change error code returned by "Require ldap-filter"
Allow to change error code returned by "Require ldap-filter"
Status: NEW
Product: Apache httpd-2
Classification: Unclassified
Component: mod_authz_ldap
2.2.9
PC Linux
: P2 enhancement (vote)
: ---
Assigned To: Apache HTTPD Bugs Mailing List
: FixedInTrunk
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-08-22 06:57 UTC by Alexandra Kossovsky
Modified: 2014-01-19 20:41 UTC (History)
0 users



Attachments
AuthzLDAPUnauthorized directive may be set to 401 or 403 (5.45 KB, patch)
2008-08-22 06:57 UTC, Alexandra Kossovsky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandra Kossovsky 2008-08-22 06:57:05 UTC
Created attachment 22474 [details]
AuthzLDAPUnauthorized directive may be set to 401 or 403

I have a configuration where different parts of website are available to different people. Something like:
<VirtualHost *:443>
AuthType Kerberos
  <Location /xxx>
    Require ldap-filter uid=*
  </Location>
  <Location /yyy>
    Require ldap-filter &(o=something)(zz=value)
  </Location>
</VirtualHost>

When user fails to pass through "require ldap-filter" directive when accessing /yyy directory, he gets error 401.  In many browsers, it means that he is re-asked to type his name/password, even if he decides to go back to /xxx directory. So, I'd like mod_authz_ldap to return 403 instead of 401 in such cases.

There already was similar bug 40721 (I completely agree with you that 401 MUST be the default error code), but I propose to make things more flexible.

The attached patch adds AuthzLDAPUnauthorized directive, which is 401 by default, but may be set to 403 by user.

If you'd like it to have boolean switch (to avoid user setting AuthzLDAPUnauthorized to 200), feel free to ask me to rework my patch.
Comment 1 Eric Covener 2014-01-19 20:41:59 UTC
Fixed in 2.4 and later with AuthzSendForbiddenOnFailure