diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index 85e43d4006b0df9929af8b4914144a7b4ccdf19a..ac1fc01cf1d8290d9ac6fc7f180d023c262115de 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -904,6 +904,7 @@ class SimpleSAML_Metadata_SAMLParser {
 		assert('is_null($expireTime) || is_int($expireTime)');
 
 		$aad = self::parseRoleDescriptorType($element, $expireTime);
+		$aad['entityid'] = $this->entityId;
 		$aad['metadata-set'] = 'attributeauthority-remote';
 
 		$extensions = SimpleSAML_Utilities::getDOMChildren($element, 'Extensions', '@md');