mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
parent
1d4262579e
commit
d4c16bc57f
6 changed files with 26 additions and 7 deletions
|
|
@ -1,5 +1,5 @@
|
|||
PLUGIN_NAME= web-proxy-sso
|
||||
PLUGIN_VERSION= 2.0
|
||||
PLUGIN_VERSION= 2.1
|
||||
PLUGIN_COMMENT= Kerberos authentication module
|
||||
PLUGIN_DEPENDS= msktutil cyrus-sasl-gssapi
|
||||
PLUGIN_MAINTAINER= evbevz@gmail.com
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ class ServiceController extends \OPNsense\Proxy\Api\ServiceController
|
|||
if ($this->request->isPost()) {
|
||||
$backend = new Backend();
|
||||
$mdl = new ProxySSO();
|
||||
$cnf = Config::getInstance()->toArray();
|
||||
$hostname = 'HTTP/' . $cnf['system']['hostname'];
|
||||
$domain = $cnf['system']['domain'];
|
||||
$kerbname = substr(strtoupper($cnf['system']['hostname']), 0, 13) . "-K";
|
||||
$cnf = Config::getInstance()->object();
|
||||
$hostname = 'HTTP/' . $cnf->system->hostname;
|
||||
$domain = $cnf->system->domain;
|
||||
$kerbname = strtoupper((string)$mdl->KerberosHostName);
|
||||
$winver = (string)$mdl->ADKerberosImplementation == 'W2008' ? '2008' : '2003';
|
||||
$username = escapeshellarg($this->request->getPost("admin_login"));
|
||||
$pass = escapeshellarg($this->request->getPost("admin_password"));
|
||||
|
|
@ -66,8 +66,8 @@ class ServiceController extends \OPNsense\Proxy\Api\ServiceController
|
|||
{
|
||||
if ($this->request->isPost()) {
|
||||
$backend = new Backend();
|
||||
$cnf = Config::getInstance()->toArray();
|
||||
$fqdn = $cnf['system']['hostname'].'.'.$cnf['system']['domain'];
|
||||
$cnf = Config::getInstance()->object();
|
||||
$fqdn = $cnf->system->hostname .'.'.$cnf->system->domain;
|
||||
$username = escapeshellarg($this->request->getPost("login"));
|
||||
$pass = escapeshellarg($this->request->getPost("password"));
|
||||
|
||||
|
|
|
|||
|
|
@ -11,4 +11,10 @@
|
|||
<type>dropdown</type>
|
||||
<help>Select Windows Server version for AD controller</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>ProxySSO.KerberosHostName</id>
|
||||
<label>Kerberos Account Name Of This Host In AD</label>
|
||||
<type>text</type>
|
||||
<help>Enter this computer account name to register in AD for kerberos access. Default is hostname with suffix '-K'.</help>
|
||||
</field>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,15 @@
|
|||
namespace OPNsense\ProxySSO;
|
||||
|
||||
use OPNsense\Base\BaseModel;
|
||||
use OPNsense\Core\Config;
|
||||
|
||||
class ProxySSO extends BaseModel
|
||||
{
|
||||
protected function init()
|
||||
{
|
||||
if($this->KerberosHostName == "") {
|
||||
$hostname = (string)Config::getInstance()->object()->system->hostname;
|
||||
$this->KerberosHostName = substr(strtoupper($hostname), 0, 13) . '-K';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,8 @@
|
|||
<W2008>Windows 2008 with AES</W2008>
|
||||
</OptionValues>
|
||||
</ADKerberosImplementation>
|
||||
<KerberosHostName type="TextField">
|
||||
<Required>N</Required>
|
||||
</KerberosHostName>
|
||||
</items>
|
||||
</model>
|
||||
|
|
|
|||
|
|
@ -25,3 +25,5 @@ rm ${PASS_TMP}
|
|||
/usr/local/libexec/squid/negotiate_kerberos_auth_test ${FQDN} | awk '{sub(/Token:/,"YR"); print $0}END{print "QQ"}' | /usr/local/libexec/squid/negotiate_kerberos_auth -s GSS_C_NO_NAME
|
||||
|
||||
/usr/local/bin/kdestroy
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue