Welcome! Log In Create A New Profile

Advanced

Authentication module help!

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
SubjectAuthorPosted

Authentication module help!

lerouxtMarch 07, 2014 09:38PM

Re: Authentication module help!

Maxim DouninMarch 10, 2014 07:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 53
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready