diff --git a/ldap/ldap_authentication/src/Controller/LoginValidatorBase.php b/ldap/ldap_authentication/src/Controller/LoginValidatorBase.php
index cb1f88c6..c90a190a 100644
--- a/ldap/ldap_authentication/src/Controller/LoginValidatorBase.php
+++ b/ldap/ldap_authentication/src/Controller/LoginValidatorBase.php
@@ -556,19 +556,22 @@ public function checkAllowedExcluded(string $authName, Entry $ldap_user): bool {
       $authorizations = $controller->getProcessedAuthorizations();
       $controller->clearAuthorizations();

-      $valid_profile = FALSE;
+      if (!$authorizations) {
+        $this->messenger->addWarning($this->t('The site logon is currently not working due to a configuration error. Please see logs for additional details.'));
+        $this->logger->notice('LDAP Authentication is configured to deny users without LDAP Authorization mappings, but 0 LDAP Authorization consumers are configured.');
+        return FALSE;
+      }
+
+      $authorizations_applied = FALSE;
       foreach ($authorizations as $authorization) {
         if (!empty($authorization->getAuthorizationsApplied())) {
-          $valid_profile = TRUE;
+          $authorizations_applied = TRUE;
         }
       }

-      if (!$valid_profile) {
-        $this->messenger->addWarning($this->t('The site logon is currently not working due to a configuration error. Please see logs for additional details.'));
-        $this->logger->notice('LDAP Authentication is configured to deny users without LDAP Authorization mappings, but 0 LDAP Authorization consumers are configured.');
+      if (!$authorizations_applied) {
         return FALSE;
       }
-
     }

     // Allow other modules to hook in and refuse if they like.
