diff --git a/modules/consentAdmin/www/consentAdmin.php b/modules/consentAdmin/www/consentAdmin.php
index 00e96ae129bf4f9c23e509a9461af99cd56d3b62..d567c1b7a33b4ba516e67643c7703d9db0476838 100644
--- a/modules/consentAdmin/www/consentAdmin.php
+++ b/modules/consentAdmin/www/consentAdmin.php
@@ -110,13 +110,11 @@ SimpleSAML_Logger::critical('consentAdmin: sp: ' .$sp_entityid.' action: '.$acti
 /*
  * Get IdP id and metadata
  */
-$session = SimpleSAML_Session::getInstance();
-
-if($session->getIdP() != null) {
+if($as->getAuthData('saml:sp:IdP') !== NULL) {
 	/*
 	 * From a remote idp (as bridge)
  	 */
-	$idp_entityid = $session->getIdP();
+	$idp_entityid = $as->getAuthData('saml:sp:IdP');
 	$idp_metadata = $metadata->getMetaData($idp_entityid, 'saml20-idp-remote');
 } else {
 	/*