diff --git a/modules/saml/lib/Controller/Metadata.php b/modules/saml/lib/Controller/Metadata.php
index 84e3efd547b8b39c2dda7c280c4a6c4f2ab96ee1..15bb343e7443234fbf72441591376c2f2cd34838 100644
--- a/modules/saml/lib/Controller/Metadata.php
+++ b/modules/saml/lib/Controller/Metadata.php
@@ -7,6 +7,7 @@ namespace SimpleSAML\Module\saml\Controller;
 use Exception;
 use SimpleSAML\Configuration;
 use SimpleSAML\Error;
+use SimpleSAML\HTTP\RunnableResponse;
 use SimpleSAML\Metadata as SSPMetadata;
 use SimpleSAML\Module;
 use SimpleSAML\Module\saml\IdP\SAML2 as SAML2_IdP;
@@ -67,7 +68,7 @@ class Metadata
      */
     public function metadata(Request $request): RunnableResponse
     {
-        if (!$this->config->getOptionalBoolean('enable.saml20-idp', false) || !Module::isModuleEnabled('saml')) {
+        if ($this->config->getBoolean('enable.saml20-idp') === false || !Module::isModuleEnabled('saml')) {
             throw new Error\Error('NOACCESS', null, 403);
         }
 
diff --git a/modules/saml/lib/Controller/SingleLogout.php b/modules/saml/lib/Controller/SingleLogout.php
index 1b2fe5f6adee67283fe259b7daafedb3e6f5e6ae..f5f9e344acdf1741c0fdeae168c9bf969553b33f 100644
--- a/modules/saml/lib/Controller/SingleLogout.php
+++ b/modules/saml/lib/Controller/SingleLogout.php
@@ -54,7 +54,7 @@ class SingleLogout
     {
         Logger::info('SAML2.0 - IdP.SingleLogoutService: Accessing SAML 2.0 IdP endpoint SingleLogoutService');
 
-        if (!$this->config->getOptionalBoolean('enable.saml20-idp', false) || !Module::isModuleEnabled('saml')) {
+        if ($this->config->getBoolean('enable.saml20-idp') === false || !Module::isModuleEnabled('saml')) {
             throw new Error\Error('NOACCESS', null, 403);
         }
 
@@ -89,7 +89,7 @@ class SingleLogout
     {
         Logger::info('SAML2.0 - IdP.initSLO: Accessing SAML 2.0 IdP endpoint init Single Logout');
 
-        if (!$this->config->getOptionalBoolean('enable.saml20-idp', false) || !Module::isModuleEnabled('saml')) {
+        if ($this->config->getOptionalBoolean('enable.saml20-idp') === false || !Module::isModuleEnabled('saml')) {
             throw new Error\Error('NOACCESS', null, 403);
         }
 
diff --git a/modules/saml/lib/Controller/WebBrowserSingleSignOn.php b/modules/saml/lib/Controller/WebBrowserSingleSignOn.php
index 032d41f2114d13ecdba15e3671317bc6aee27162..5cac59c8a9b24347a6d32ca44878a49bfc08f290 100644
--- a/modules/saml/lib/Controller/WebBrowserSingleSignOn.php
+++ b/modules/saml/lib/Controller/WebBrowserSingleSignOn.php
@@ -55,7 +55,7 @@ class WebBrowserSingleSignOn
      */
     public function artifactResolutionService(): RunnableResponse
     {
-        if (!$this->config->getOptionalBoolean('enable.saml20-idp', false) || !Module::isModuleEnabled('saml')) {
+        if ($this->config->getBoolean('enable.saml20-idp') === false || !Module::isModuleEnabled('saml')) {
             throw new Error\Error('NOACCESS', null, 403);
         }
 
@@ -123,7 +123,7 @@ class WebBrowserSingleSignOn
     {
         Logger::info('SAML2.0 - IdP.SSOService: Accessing SAML 2.0 IdP endpoint SSOService');
 
-        if (!$this->config->getOptionalBoolean('enable.saml20-idp', false) || !Module::isModuleEnabled('saml')) {
+        if ($this->config->getBoolean('enable.saml20-idp') === false || !Module::isModuleEnabled('saml')) {
             throw new Error\Error('NOACCESS', null, 403);
         }