Skip to content

Commit

Permalink
Add tenant uuid to salm2.error_detail, to provide more context
Browse files Browse the repository at this point in the history
  • Loading branch information
vopolonc committed Sep 28, 2023
1 parent dbac551 commit 112ce47
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Http/Controllers/Saml2Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ public function acs(Auth $auth)
$errors = $auth->acs();

if (!empty($errors)) {
logger()->error('saml2.error_detail', ['error' => $auth->getLastErrorReason()]);
session()->flash('saml2.error_detail', [$auth->getLastErrorReason()]);
$error = $auth->getLastErrorReason();
$uuid = $auth->getTenant()->uuid;

logger()->error('saml2.error_detail', compact('uuid', 'error'));
session()->flash('saml2.error_detail', [$error]);

logger()->error('saml2.error', $errors);
session()->flash('saml2.error', $errors);
Expand Down Expand Up @@ -89,8 +92,11 @@ public function sls(Auth $auth)
$errors = $auth->sls(config('saml2.retrieveParametersFromServer'));

if (!empty($errors)) {
logger()->error('saml2.error_detail', ['error' => $auth->getLastErrorReason()]);
session()->flash('saml2.error_detail', [$auth->getLastErrorReason()]);
$error = $auth->getLastErrorReason();
$uuid = $auth->getTenant()->uuid;

logger()->error('saml2.error_detail', compact('uuid', 'error'));
session()->flash('saml2.error_detail', [$error]);

logger()->error('saml2.error', $errors);
session()->flash('saml2.error', $errors);
Expand Down

0 comments on commit 112ce47

Please sign in to comment.