diff --git a/www/saml2/idp/SSOService.php b/www/saml2/idp/SSOService.php
index 7293f69d7620d3fe6ef871fdeafeb881305f4460..15db347978cb4eb284fb1b06c575ad72a0d288ad 100644
--- a/www/saml2/idp/SSOService.php
+++ b/www/saml2/idp/SSOService.php
@@ -181,7 +181,9 @@ if (!isset($session) || !$session->isValid($authority) ) {
 		 */
 		$ar = new SimpleSAML_XML_SAML20_AuthnResponse($config, $metadata);
 		$afilter = new SimpleSAML_XML_AttributeFilter($config, $session->getAttributes());
-		
+		if (isset($idpmetadata['attributemap'])) {
+			$afilter->namemap($idpmetadata['attributemap']);
+		}
 		if (isset($spmetadata['attributemap'])) {
 			$afilter->namemap($spmetadata['attributemap']);
 		}