diff --git a/lib/SimpleSAML/IdP.php b/lib/SimpleSAML/IdP.php
index 5d9134f95f73e12bc8630ca349ac71d05370a3b7..f3bd3e1c6be3dcf0c7bb7c48d46674d1aa0aa4f2 100644
--- a/lib/SimpleSAML/IdP.php
+++ b/lib/SimpleSAML/IdP.php
@@ -199,7 +199,16 @@ class SimpleSAML_IdP {
 	public function getAssociations() {
 
 		$session = SimpleSAML_Session::getInstance();
-		return $session->getAssociations($this->associationGroup);
+
+		$associations = $session->getAssociations($this->associationGroup);
+
+		foreach ($associations as &$a) {
+			if (!isset($a['core:IdP'])) {
+				$a['core:IdP'] = $this->id;
+			}
+		}
+
+		return $associations;
 	}