[NGINX] Please add auth_request support in GUI
Pretty simple request actually: Create a way to add the NGINX auth_request feature to locations from the GUI.
Doesn't have to be anything special. Even if it's just one field with an url thats checked for being http 200, that would open up a lot of options.
I already built that feature into native OPNsense. It is an advanced setting and allows checking any authentication server in OPNsense. So you can use LDAP, RADIUS, internal or add a custom authenticator.
@fabianfrz Would "Basic Authentication" in the GUI do this? I don't understand the help text: "Enter the realm for this directory and enable authentication."
What the fuck is a "realm" within NGINX? The manual of NGINX als doesn't understand the term "realm".
Is this just the basic auth_request?
edit Found the other settings, such as LDAP, RADIUS, VOUCHER, etc. :) Thats still not just an auth_request though...
I've a site (lets call it x.com), that needs to only be accessable if someone is logged in on another site (lets call it y.com). y.com does this by making sure it sends http 200 if the user is logged in and 401 thats not the case.
With an auth_request this is super duper easy: auth_request https://y.com proxy_pass https://x.com
(crude TL:DR version)
edit 2 Another question: If we use "Advanced ACL Authentication Backend" with (for example) LDAP. Does it already set the headers to verify the user downstream?
For example: X-Forwarded-User would be pretty nice to have. If not, that should be a relatively small addition. (possibly under a checkbox though)
If you would have an user already, you would not call an authentication request. It forwards the credentials to verify them using the specified auth server. So what you probably need is not a change in the nginx plugin itself but an auth server that does only check basic auth.
This is the authentication callback this feature does and may need slightly adjustments if you want to pass the host to an auth backend but it already has all the values: https://github.com/opnsense/plugins/blob/master/www/nginx/src/opnsense/scripts/nginx/ngx_auth.php
@fabianfrz
If you would have an user already, you would not call an authentication request. It forwards the credentials to verify them using the specified auth server
Could you PLEASE quote which question you are answering (next time)? I don't get if you either don't understand my auth_request question or the second question about "X-Forwarded-User"?
Anyhow: I just need to be able to set "auth_request"! (thats my main question and unrelated to the one about "X-Forwarded-User"(!)... )
Example: (Look at "auth_request")
location /private/ {
auth_request /auth-0;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass http://192.168.31.22:9091;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
This is a basic NGINX proxy feature! I don't need another Auth server, I just need this basic NGINX feature called "auth_request" supported...
I just need to be able to set this to what I need... Thats not unusual and a LOT of people use it that way...
I think we have a language problem. So I made a mockup picture
I need this field:
This should add:
auth_request https://blabla.com/auth-0;
To the location.
This issue has been automatically timed-out (after 180 days of inactivity).
For more information about the policies for this repository, please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.
If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.