Welcome! Log In Create A New Profile

Advanced

[PATCH] Allow http_auth_request_module to forward 302 responses

Maxim Khitrov
February 18, 2012 09:20AM
Hello Maxim,

The attached patch allows your http_auth_request_module to forward a
302 response and the associated "Location" header to the client. The
goal is to allow the authentication back end to redirect the client to
a login page instead of using WWW-Authenticate header.

I'm currently attempting to use your module to authenticate users
against an Active Directory server. I have a PHP script that can
perform the necessary security checks and cache user credentials for
better performance. The problem is that if I rely on HTTP Basic
authentication, I lose control over the client's session (timeout,
logout, etc.). I know that it is possible to force some browsers to
"forget" the credentials in order to log out, but it's a hack that I'd
rather avoid.

The best solution is to use cookies, but for this I need to be able to
redirect the user to the login page when authentication fails. The
current behavior of the auth_request module is to return an Internal
Server Error for any response code other than 401, 403, or 200.

To make this patch, I simply copied your handling of the
www_authenticate header. If there is a more elegant solution or some
additional logic required, please feel free to change the code as
needed.

- Max
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Allow http_auth_request_module to forward 302 responses Attachments

Maxim Khitrov 1266 February 18, 2012 09:20AM

Re: [PATCH] Allow http_auth_request_module to forward 302 responses

Maxim Dounin 542 February 18, 2012 04:46PM

Re: [PATCH] Allow http_auth_request_module to forward 302 responses

Maxim Khitrov 544 February 18, 2012 06:50PM

Re: [PATCH] Allow http_auth_request_module to forward 302 responses

Maxim Dounin 533 February 18, 2012 11:02PM

Re: [PATCH] Allow http_auth_request_module to forward 302 responses

Maxim Khitrov 2180 February 19, 2012 08:42AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 144
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready