From 963735cc0cab3815e5ef353fc64545d2d340ff22 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Fri, 22 Jun 2012 11:36:57 +0000
Subject: [PATCH] saml: Add support for overriding SAML 2.0 SP authentication
 request generation.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3124 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/saml/lib/Auth/Source/SP.php | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php
index 9f39475d6..20b8e486c 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -257,12 +257,27 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
 
 		SimpleSAML_Logger::debug('Sending SAML 2 AuthnRequest to ' . var_export($idpMetadata->getString('entityid'), TRUE));
 		$b = new SAML2_HTTPRedirect();
-		$b->send($ar);
+		$this->sendSAML2AuthnRequest($state, $b, $ar);
 
 		assert('FALSE');
 	}
 
 
+	/**
+	 * Function to actually send the authentication request.
+	 *
+	 * This function does not return.
+	 *
+	 * @param array &$state  The state array.
+	 * @param SAML2_Binding $binding  The binding.
+	 * @param SAML2_AuthnRequest  $ar  The authentication request.
+	 */
+	public function sendSAML2AuthnRequest(array &$state, SAML2_Binding $binding, SAML2_AuthnRequest $ar) {
+		$binding->send($ar);
+		assert('FALSE');
+	}
+
+
 	/**
 	 * Send a SSO request to an IdP.
 	 *
-- 
GitLab