diff --git a/src/opnsense/mvc/app/library/OPNsense/Auth/AuthenticationFactory.php b/src/opnsense/mvc/app/library/OPNsense/Auth/AuthenticationFactory.php index 1e5ed66d7..311a4f205 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Auth/AuthenticationFactory.php +++ b/src/opnsense/mvc/app/library/OPNsense/Auth/AuthenticationFactory.php @@ -146,9 +146,11 @@ class AuthenticationFactory */ public function getService($service_name) { + // cleanse service name + $srv_name = str_replace('-', '_', strtolower($service_name)); foreach (glob(__DIR__."/Services/*.php") as $filename) { $srv_found = basename($filename, '.php'); - if (strtolower($srv_found) == strtolower($service_name)) { + if (strtolower($srv_found) == $srv_name) { $reflClass = new \ReflectionClass("OPNsense\\Auth\\Services\\{$srv_found}"); if ($reflClass->implementsInterface('OPNsense\\Auth\\IService')) { return $reflClass->newInstance(); diff --git a/src/opnsense/mvc/app/library/OPNsense/Auth/Services/Opnsense_Auth_Test.php b/src/opnsense/mvc/app/library/OPNsense/Auth/Services/Opnsense_Auth_Test.php new file mode 100644 index 000000000..8a4efe0de --- /dev/null +++ b/src/opnsense/mvc/app/library/OPNsense/Auth/Services/Opnsense_Auth_Test.php @@ -0,0 +1,40 @@ +