From 2f64bc588a97cae201335613927ce802a7cf5e9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Wed, 1 Jun 2011 07:45:33 +0000
Subject: [PATCH] Adding a saml:idp parameter to select IdP for
 modules/core/www/as_login.php

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2859 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/core/www/as_login.php | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/modules/core/www/as_login.php b/modules/core/www/as_login.php
index 55ab960bd..143dde6c1 100644
--- a/modules/core/www/as_login.php
+++ b/modules/core/www/as_login.php
@@ -15,9 +15,24 @@ if (!is_string($_REQUEST['AuthId'])) {
 	throw new SimpleSAML_Error_BadRequest('Missing AuthId parameter.');
 }
 
-$as = new SimpleSAML_Auth_Simple($_REQUEST['AuthId']);
-$as->requireAuth(array(
+/*
+ * Setting up the options for the requireAuth() call later..
+ */
+$options = array(
 	'ReturnTo' => $_REQUEST['ReturnTo'],
-));
+);
+
+/*
+ * Allows a saml:idp query string parameter specify the IdP entity ID to be used
+ * as used by the DiscoJuice embedded client.
+ */
+if (!empty($_REQUEST['saml:idp'])) {
+	$options['saml:idp'] = $_REQUEST['saml:idp'];
+}
+
+
+
+$as = new SimpleSAML_Auth_Simple($_REQUEST['AuthId']);
+$as->requireAuth($options);
 
 SimpleSAML_Utilities::redirect($_REQUEST['ReturnTo']);
-- 
GitLab