From: Dan Brown Date: Tue, 20 Sep 2022 11:52:44 +0000 (+0100) Subject: Added reason, if existing, into SAML acs error X-Git-Tag: v22.09.1~1^2~2 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/dce6a8295469f6860fa32b00f85c522d315a74a9 Added reason, if existing, into SAML acs error Closes #3731 --- diff --git a/app/Auth/Access/Saml2Service.php b/app/Auth/Access/Saml2Service.php index f5d0cd7cc..b0bf39995 100644 --- a/app/Auth/Access/Saml2Service.php +++ b/app/Auth/Access/Saml2Service.php @@ -109,9 +109,10 @@ class Saml2Service $errors = $toolkit->getErrors(); if (!empty($errors)) { - throw new Error( - 'Invalid ACS Response: ' . implode(', ', $errors) - ); + $reason = $toolkit->getLastErrorReason(); + $message = 'Invalid ACS Response; Errors: ' . implode(', ', $errors); + $message .= $reason ? "; Reason: {$reason}" : ''; + throw new Error($message); } if (!$toolkit->isAuthenticated()) {