Skip to content
Snippets Groups Projects
Commit db981bc5 authored by Olav Morken's avatar Olav Morken
Browse files

consent: Use $state['saml:sp:IdP'] instead of $session->getIdP().

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2652 44740490-163a-0410-bde0-09ae8108e29a
parent 6ab0f430
No related branches found
No related tags found
No related merge requests found
......@@ -149,11 +149,15 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
$session = SimpleSAML_Session::getInstance();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
/* If the consent module is active on a bridge $session->getIdP() will contain
* an entry id for the remote IdP. If $session->getIdP() is NULL, then the
/* If the consent module is active on a bridge $state['saml:sp:IdP'] will contain
* an entry id for the remote IdP. If not, then the
* consent module is active on a local IdP and nothing needs to be done.
*/
if($session->getIdP() != null) {
if(isset($state['saml:sp:IdP'])) {
$idpmeta = $metadata->getMetaData($state['saml:sp:IdP'], 'saml20-idp-remote');
$state['Source'] = $idpmeta;
} elseif($session->getIdP() !== NULL) {
/* For backwards compatibility. TODO: Remove in version 1.8. */
$idpmeta = $metadata->getMetaData($session->getIdP(), 'saml20-idp-remote');
$state['Source'] = $idpmeta;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment