proxy: allow alt auth framework config file

We fall back to the local authentication if not found.

PR: https://github.com/opnsense/plugins/issues/43
This commit is contained in:
Franco Fichtner 2016-10-26 08:01:25 +02:00
parent 2d450939a0
commit 35122576f4
3 changed files with 15 additions and 13 deletions

1
plist
View File

@ -674,6 +674,7 @@
/usr/local/opnsense/service/templates/OPNsense/Proxy/rc.conf.d
/usr/local/opnsense/service/templates/OPNsense/Proxy/squid.acl.conf
/usr/local/opnsense/service/templates/OPNsense/Proxy/squid.conf
/usr/local/opnsense/service/templates/OPNsense/Proxy/squid.user.local_auth.conf
/usr/local/opnsense/service/templates/OPNsense/Sample/+TARGETS
/usr/local/opnsense/service/templates/OPNsense/Sample/example_config.txt
/usr/local/opnsense/service/templates/OPNsense/Sample/example_parent.txt

View File

@ -255,19 +255,7 @@ icap_enable off
# Authentication Settings
{% if helpers.exists('OPNsense.proxy.forward.authentication.method') and OPNsense.proxy.forward.authentication.method != '' %}
# Configure Local User Authentication helper
auth_param basic program /usr/local/etc/inc/squid.auth-user.php
{% if helpers.exists('OPNsense.proxy.forward.authentication.realm') %}
auth_param basic realm {{OPNsense.proxy.forward.authentication.realm}}
{% endif %}
{% if helpers.exists('OPNsense.proxy.forward.authentication.credentialsttl') %}
auth_param basic credentialsttl {{OPNsense.proxy.forward.authentication.credentialsttl}} hours
{% endif %}
{% if helpers.exists('OPNsense.proxy.forward.authentication.children') %}
auth_param basic children {{OPNsense.proxy.forward.authentication.children}}
{% endif %}
# ACL - Local Authorized Users - local_auth
acl local_auth proxy_auth REQUIRED
{% include ['OPNsense/Proxy/squid.user.alt_auth.conf', 'OPNsense/Proxy/squid.user.local_auth.conf'] %}
{% endif %}
{% include "OPNsense/Proxy/squid.user.pre_auth.conf" ignore missing with context %}

View File

@ -0,0 +1,13 @@
# Configure Local User Authentication helper
auth_param basic program /usr/local/etc/inc/squid.auth-user.php
{% if helpers.exists('OPNsense.proxy.forward.authentication.realm') %}
auth_param basic realm {{OPNsense.proxy.forward.authentication.realm}}
{% endif %}
{% if helpers.exists('OPNsense.proxy.forward.authentication.credentialsttl') %}
auth_param basic credentialsttl {{OPNsense.proxy.forward.authentication.credentialsttl}} hours
{% endif %}
{% if helpers.exists('OPNsense.proxy.forward.authentication.children') %}
auth_param basic children {{OPNsense.proxy.forward.authentication.children}}
{% endif %}
# ACL - Local Authorized Users - local_auth
acl local_auth proxy_auth REQUIRED