March 07, 2014 09:38PM
Hi, I'm trying to integrate nginx with a proprietary authentication scheme and I need a bit of help!

The auth scheme is this: traffic is allowed through nginx if there exists a cookie containing a valid HMAC. If not, nginx is to redirect to an auth server (same domain) which will prompt the user for credentials. Upon successful login the auth server will emit a valid HMAC and then redirect the user back to nginx which will then validate and do its thing.

The HMAC validation is proprietary and there exists a C lib to perform the task. I figured writing an nginx module that will exeucte during the access phase would do the trick. Trouble is, I can't figure out how to do the redirect to the auth server in the case the HMAC is missing or invalid. Try as I might, I just can't get nginx to do a temporary redirect in the access phase (i can do this just fine in the content phase!).

What's the preferred approach for doing this? Can it be done all in the module, or do I need a combination of module + error_page redirection?

-Tom
Subject Author Posted

Authentication module help!

lerouxt March 07, 2014 09:38PM

Re: Authentication module help!

Maxim Dounin March 10, 2014 07:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
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