diff --git a/lib/SimpleSAML/Consent/Consent.php b/lib/SimpleSAML/Consent/Consent.php
index dbc8a23c7e52cc5dc17c16a61f70cd9da3a40765..d1d1629d59e47ff9291d87d80c17df78c942907e 100644
--- a/lib/SimpleSAML/Consent/Consent.php
+++ b/lib/SimpleSAML/Consent/Consent.php
@@ -80,7 +80,7 @@ class SimpleSAML_Consent_Consent {
 				$userid_attributename . '] was not available.');
 		}
 		
-		$userid = $this->attributes[$userid_attributename];
+		$userid = $this->attributes[$userid_attributename][0];
 		
 		return hash('sha1', $userid . $this->salt . $this->getIdPID() );
 	}