diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 98700056111eef8af153ad92202254269e692288..b20fd8543c8c6b4a709c41bccb7b33df563e73a4 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -158,8 +158,9 @@ class OC_App {
 					throw $ex;
 				}
 				\OC::$server->getLogger()->logException($ex);
-				if (!\OC::$server->getAppManager()->isShipped($app)) {
-					// Only disable apps which are not shipped
+
+				if (!\OC::$server->getAppManager()->isShipped($app) && !self::isType($app, ['authentication'])) {
+					// Only disable apps which are not shipped and that are not authentication apps
 					\OC::$server->getAppManager()->disableApp($app, true);
 				}
 			}