From c929577c1db3386de40440faff0d1d9a5abe3829 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Wed, 22 May 2013 08:25:25 +0000 Subject: [PATCH] saml: Fix saml:sp:IdP for SAML 1.1 The saml:sp:IdP authentication data was only saved for SAML 2.0 authentication. This patch moves this variable into common code, so that it is shared between SAML 2.0 and SAML 1.1. Thanks to Tim Jobling for reporting this bug! git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3240 44740490-163a-0410-bde0-09ae8108e29a --- modules/saml/lib/Auth/Source/SP.php | 4 ++++ modules/saml/www/sp/saml2-acs.php | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php index ebeea693d..32d4bcc5e 100644 --- a/modules/saml/lib/Auth/Source/SP.php +++ b/modules/saml/lib/Auth/Source/SP.php @@ -459,6 +459,10 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source { $spMetadataArray = $this->metadata->toArray(); $idpMetadataArray = $idpMetadata->toArray(); + /* Save the IdP in the state array. */ + $state['saml:sp:IdP'] = $idp; + $state['PersistentAuthData'][] = 'saml:sp:IdP'; + $authProcState = array( 'saml:sp:IdP' => $idp, 'saml:sp:State' => $state, diff --git a/modules/saml/www/sp/saml2-acs.php b/modules/saml/www/sp/saml2-acs.php index 4dccbf489..d9dfee9e7 100644 --- a/modules/saml/www/sp/saml2-acs.php +++ b/modules/saml/www/sp/saml2-acs.php @@ -162,8 +162,6 @@ $state['saml:AuthenticatingAuthority'] = $authenticatingAuthority; $state['saml:AuthenticatingAuthority'][] = $idp; $state['PersistentAuthData'][] = 'saml:AuthenticatingAuthority'; -$state['saml:sp:IdP'] = $idp; -$state['PersistentAuthData'][] = 'saml:sp:IdP'; $state['saml:sp:NameID'] = $nameId; $state['PersistentAuthData'][] = 'saml:sp:NameID'; $state['saml:sp:SessionIndex'] = $sessionIndex; -- GitLab