diff --git a/www/shib13/idp/SSOService.php b/www/shib13/idp/SSOService.php
index 7b622eda36b7ae6356c788c9435dd179f86ae8ac..44c3e6ce1fa30f06f9cd778ec3f7c7390c1b7656 100644
--- a/www/shib13/idp/SSOService.php
+++ b/www/shib13/idp/SSOService.php
@@ -110,7 +110,8 @@ if (!$session->isAuthenticated() ) {
 
 		//$session->setAttribute('eduPersonAffiliation', array('student'));
 
-
+		$spentityid = $authnrequest->getIssuer();
+		$spmetadata = $metadata->getMetaData($spentityid, 'shib13-sp-remote');
 
 		/*
 		 * Filtering attributes.