]> BookStack Code Mirror - bookstack/commitdiff
Added reason, if existing, into SAML acs error
authorDan Brown <redacted>
Tue, 20 Sep 2022 11:52:44 +0000 (12:52 +0100)
committerDan Brown <redacted>
Tue, 20 Sep 2022 11:52:44 +0000 (12:52 +0100)
Closes #3731

app/Auth/Access/Saml2Service.php

index f5d0cd7ccf57ee61fd863c8a85f5f9144d71db75..b0bf39995e63f0b050aabf67d4cd8af05abadebc 100644 (file)
@@ -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()) {