diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 2c94cc70b2..b5f6c63c1c 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -74,6 +74,12 @@ class LoginController extends Controller return redirect()->intended('/'); } + //If the environment is set to ALWAYS require SAML, go straight to the SAML route. + if((env("REQUIRE_SAML", false))) + { + return redirect()->route('saml.login'); + } + if ($this->saml->isEnabled() && Setting::getSettings()->saml_forcelogin == '1' && ! ($request->has('nosaml') || $request->session()->has('error'))) { return redirect()->route('saml.login'); } diff --git a/config/app.php b/config/app.php index e8d1ebae49..ceb358e587 100755 --- a/config/app.php +++ b/config/app.php @@ -250,8 +250,19 @@ return [ 'enable_csp' => env('ENABLE_CSP', false), + /* + |-------------------------------------------------------------------------- + | Require SAML Login + |-------------------------------------------------------------------------- + | + | Disable the ability to login via form login, and require all logins to + | process via SAML login. (If you are not using SAML, this option should + | be left alone.) + | + */ - + 'require_saml' => env('REQUIRE_SAML', false), + /* |--------------------------------------------------------------------------