Skip to content

A free open source IT asset/license management system

Allow saml to be more easily debugged

Johnson Yi1c4e20c712ae
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index e4034e6204..4ccbc6ebd8 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -105,13 +105,13 @@ class LoginController extends Controller
$samlData = $request->session()->get('saml_login');
if ($saml->isEnabled() && !empty($samlData)) {
try {
- LOG::debug("Attempting to log user in by SAML authentication.");
+ Log::debug("Attempting to log user in by SAML authentication.");
$user = $saml->samlLogin($samlData);
if(!is_null($user)) {
Auth::login($user, true);
} else {
$username = $saml->getUsername();
- LOG::debug("SAML user '$username' could not be found in database.");
+ Log::error("SAML user '$username' could not be found in database.");
$request->session()->flash('error', trans('auth/message.signin.error'));
$saml->clearData();
}
@@ -121,7 +121,7 @@ class LoginController extends Controller
$user->save();
}
} catch (\Exception $e) {
- LOG::debug("There was an error authenticating the SAML user: " . $e->getMessage());
+ Log::error("There was an error authenticating the SAML user: " . $e->getMessage());
throw new \Exception($e->getMessage());
}
}
diff --git a/app/Http/Controllers/Auth/SamlController.php b/app/Http/Controllers/Auth/SamlController.php
index dd48ab169e..48c8d05ab8 100644
--- a/app/Http/Controllers/Auth/SamlController.php
+++ b/app/Http/Controllers/Auth/SamlController.php
@@ -101,8 +101,8 @@ class SamlController extends Controller
$errors = $auth->getErrors();
if (!empty($errors)) {
- Log::debug("There was an error with SAML ACS: " . implode(', ', $errors));
- Log::debug("Reason: " . $auth->getLastErrorReason());
+ Log::error("There was an error with SAML ACS: " . implode(', ', $errors));
+ Log::error("Reason: " . $auth->getLastErrorReason());
return redirect()->route('login')->with('error', trans('auth/message.signin.error'));
}
@@ -115,7 +115,7 @@ class SamlController extends Controller
* Receives LogoutRequest/LogoutResponse from IdP and flashes
* back to the LoginController for logging out.
*
- * /saml/slo
+ * /saml/sls
*
* @author Johnson Yi <[email protected]>
*
@@ -132,8 +132,8 @@ class SamlController extends Controller
$errors = $auth->getErrors();
if (!empty($errors)) {
- Log::debug("There was an error with SAML SLS: " . implode(', ', $errors));
- Log::debug("Reason: " . $auth->getLastErrorReason());
+ Log::error("There was an error with SAML SLS: " . implode(', ', $errors));
+ Log::error("Reason: " . $auth->getLastErrorReason());
return view('errors.403');
}