Skip to content

NOW MANAGED ON CODEBERG

Added reason, if existing, into SAML acs error

Dan Browndce6a8295469
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()) {