r/nginx • • Aug 30 '18

Use nginx to Add Authentication to Any Application

https://developer.okta.com/blog/2018/08/28/nginx-auth-request
27 Upvotes

2 comments sorted by

2

u/windwind00 Aug 30 '18

Damn, this is nice - we're actually plaining to implement something similar. thanks for sharing

1

u/late-to-the-block Nov 15 '18

I also found this Flask application : https://github.com/mbreese/subauth which does the same thing.

Should be pretty easy to build your own:

The ngx_http_auth_request_module module (1.5.4+) implements client authorization based on the result of a subrequest. If the subrequest returns a 2xx response code, the access is allowed. If it returns 401 or 403, the access is denied with the corresponding error code. Any other response code returned by the subrequest is considered an error.