Add option to environment to require SAML for a more secure installation.

This commit is contained in:
Alex Janes 2021-12-16 11:44:07 -05:00
parent 52322806fa
commit 3c8d70c5fb
2 changed files with 18 additions and 1 deletions

View file

@ -74,6 +74,12 @@ class LoginController extends Controller
return redirect()->intended('/'); 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'))) { if ($this->saml->isEnabled() && Setting::getSettings()->saml_forcelogin == '1' && ! ($request->has('nosaml') || $request->session()->has('error'))) {
return redirect()->route('saml.login'); return redirect()->route('saml.login');
} }

View file

@ -250,7 +250,18 @@ return [
'enable_csp' => env('ENABLE_CSP', false), '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),
/* /*