Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/user_saml.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-29 01:15:40 +0300
committerLukas Reschke <lukas@owncloud.com>2016-06-29 01:15:40 +0300
commit328c77e389fb7fd3b4eaa9b3bc9055ba5c739199 (patch)
tree231f63ae06780839e1453b85a1f454f2bd561b09 /appinfo
parentada6b6ebc800c8b44e7e10144b72ce07ce1cd8da (diff)
Don't auth against SAML if invalid config
Fixes https://github.com/nextcloud/user_saml/issues/7
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/app.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
index 57bb91d9..abc11023 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -21,7 +21,19 @@
require_once __DIR__ . '/../3rdparty/vendor/autoload.php';
+\OCP\App::registerAdmin('user_saml', 'admin');
+
$urlGenerator = \OC::$server->getURLGenerator();
+$config = \OC::$server->getConfig();
+$samlSettings = new \OCA\User_SAML\SAMLSettings(
+ $urlGenerator,
+ $config
+);
+try {
+ $oneLoginSettings = new \OneLogin_Saml2_Settings($samlSettings->getOneLoginSettingsArray());
+} catch(OneLogin_Saml2_Error $e) {
+ return;
+}
$userBackend = new \OCA\User_SAML\UserBackend(
\OC::$server->getConfig(),
@@ -39,4 +51,3 @@ if($currentUrl === '/server/index.php/login' && !OC_User::isLoggedIn()) {
exit();
}
-\OCP\App::registerPersonal('user_saml', 'admin');