From 7fbb051ca32d607abb3e9ae2cd847f2ce1be76cf Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 13 Jul 2009 06:19:58 +0000
Subject: [PATCH] saml2: Make SP authentication source throw a detailed
 exception when receiving an error from the IdP.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1580 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/saml2/www/sp/acs.php | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/saml2/www/sp/acs.php b/modules/saml2/www/sp/acs.php
index 929257e5f..57d26db67 100644
--- a/modules/saml2/www/sp/acs.php
+++ b/modules/saml2/www/sp/acs.php
@@ -34,8 +34,7 @@ $result = $authnResponse->process();
 /* Check status code. */
 if($result === FALSE) {
 	/* Not successful. */
-	$statusCode = $authnResponse->findstatus();
-	throw new Exception('Error authenticating: ' . $statusCode);
+	SimpleSAML_Auth_State::throwException($state, $authnResponse->getStatus()->toException());
 }
 
 /* The response should include the entity id of the IdP. */
-- 
GitLab