From 04bed462e01472d7b7798167bf65a5586b66d5f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Tue, 16 Oct 2007 14:18:32 +0000
Subject: [PATCH] Improved error message if could not find SAMLResponse field
 in browser/POST

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@31 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Bindings/SAML20/HTTPPost.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/SimpleSAML/Bindings/SAML20/HTTPPost.php b/lib/SimpleSAML/Bindings/SAML20/HTTPPost.php
index 478c52e4b..924ed9afe 100644
--- a/lib/SimpleSAML/Bindings/SAML20/HTTPPost.php
+++ b/lib/SimpleSAML/Bindings/SAML20/HTTPPost.php
@@ -188,9 +188,13 @@ class SimpleSAML_Bindings_SAML20_HTTPPost {
 	}
 	
 	public function decodeResponse($post) {
+		if (!isset($post["SAMLResponse"])) throw new Exception('Could not get SAMLResponse from Browser/POST. May be there is some redirection related problem on your server? In example apache redirecting the POST to http to a GET on https.');
+		
 		$rawResponse = 	$post["SAMLResponse"];
 		$relaystate = 	$post["RelayState"];
 		
+
+		
 		$samlResponseXML = base64_decode( $rawResponse );
 		
 		//error_log("Response is: " . $samlResponseXML);
-- 
GitLab