From 1e66c157427a8e143729bff4366d2c974de6de07 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 26 Oct 2010 08:44:58 +0000
Subject: [PATCH] saml:PersistentNameID: Fix generation of persistent NameID.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2610 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/saml/lib/Auth/Process/PersistentNameID.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/saml/lib/Auth/Process/PersistentNameID.php b/modules/saml/lib/Auth/Process/PersistentNameID.php
index 97dbcf465..5d44689bd 100644
--- a/modules/saml/lib/Auth/Process/PersistentNameID.php
+++ b/modules/saml/lib/Auth/Process/PersistentNameID.php
@@ -42,17 +42,17 @@ class sspmod_saml_Auth_Process_PersistentNameID extends sspmod_saml_BaseNameIDGe
 	 */
 	protected function getValue(array &$state) {
 
-		if (!isset($state['SPMetadata']['entityid'])) {
+		if (!isset($state['Destination']['entityid'])) {
 			SimpleSAML_Logger::warning('No SP entity ID - not generating persistent NameID.');
 			return NULL;
 		}
-		$spEntityId = $state['SPMetadata']['entityid'];
+		$spEntityId = $state['Destination']['entityid'];
 
-		if (!isset($state['IdPMetadata']['entityid'])) {
+		if (!isset($state['Source']['entityid'])) {
 			SimpleSAML_Logger::warning('No IdP entity ID - not generating persistent NameID.');
 			return NULL;
 		}
-		$idpEntityId = $state['IdPMetadata']['entityid'];
+		$idpEntityId = $state['Source']['entityid'];
 
 		if (!isset($state['Attributes'][$this->attribute]) || count($state['Attributes'][$this->attribute]) === 0) {
 			SimpleSAML_Logger::warning('Missing attribute ' . var_export($this->attribute, TRUE) . ' on user - not generating persistent NameID.');
-- 
GitLab