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

shib13/idp/SSOService.php: Use getMetadataConfig for SP metadata.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1942 44740490-163a-0410-bde0-09ae8108e29a
parent da469419
No related branches found
No related tags found
No related merge requests found
...@@ -104,7 +104,7 @@ if (isset($_GET['shire'])) { ...@@ -104,7 +104,7 @@ if (isset($_GET['shire'])) {
/* Make sure that the issuer is a valid SP. */ /* Make sure that the issuer is a valid SP. */
try { try {
$spmetadata = $metadata->getMetaData($requestcache['Issuer'], 'shib13-sp-remote'); $spMetadata = $metadata->getMetaDataConfig($requestcache['Issuer'], 'shib13-sp-remote');
} catch (Exception $exception) { } catch (Exception $exception) {
SimpleSAML_Utilities::fatalError($session->getTrackID(), 'PROCESSAUTHNREQUEST', $exception); SimpleSAML_Utilities::fatalError($session->getTrackID(), 'PROCESSAUTHNREQUEST', $exception);
} }
...@@ -140,7 +140,7 @@ if (!$session->isValid($authority) ) { ...@@ -140,7 +140,7 @@ if (!$session->isValid($authority) ) {
if($authSource) { if($authSource) {
/* Authenticate with an AuthSource. */ /* Authenticate with an AuthSource. */
$hints = array( $hints = array(
'SPMetadata' => $spmetadata, 'SPMetadata' => $spMetadata->toArray(),
'IdPMetadata' => $idpmetadata, 'IdPMetadata' => $idpmetadata,
); );
...@@ -161,15 +161,14 @@ if (!$session->isValid($authority) ) { ...@@ -161,15 +161,14 @@ if (!$session->isValid($authority) ) {
* service. * service.
*/ */
try { try {
$spmetadata = $metadata->getMetaData($requestcache['Issuer'], 'shib13-sp-remote');
/* Validate the Shire the response should be sent to. */ /* Validate the Shire the response should be sent to. */
$shire = $requestcache['shire']; $shire = $requestcache['shire'];
if (!array_key_exists('AssertionConsumerService', $spmetadata)) { if (!$spMetadata->hasValue('AssertionConsumerService')) {
throw new Exception('Could not find [AssertionConsumerService] in Shib 1.3 Service Provider remote metadata.'); throw new Exception('Could not find [AssertionConsumerService] in Shib 1.3 Service Provider remote metadata.');
} }
$foundACS = FALSE; $foundACS = FALSE;
foreach (SimpleSAML_Utilities::arrayize($spmetadata['AssertionConsumerService']) as $acs) { foreach ($spMetadata->getArrayizeString('AssertionConsumerService') as $acs) {
if ($acs === $shire) { if ($acs === $shire) {
SimpleSAML_Logger::info('Shib1.3 - IdP.SSOService: Found AssertionConsumerService: '. $acs); SimpleSAML_Logger::info('Shib1.3 - IdP.SSOService: Found AssertionConsumerService: '. $acs);
$foundACS = TRUE; $foundACS = TRUE;
...@@ -178,7 +177,7 @@ try { ...@@ -178,7 +177,7 @@ try {
} }
if (!$foundACS) { if (!$foundACS) {
throw new Exception('Invalid AssertionConsumerService for SP ' . throw new Exception('Invalid AssertionConsumerService for SP ' .
var_export($spmetadata['entityid'], TRUE) . ': ' . var_export($shire, TRUE)); var_export($spMetadata->getString('entityid'), TRUE) . ': ' . var_export($shire, TRUE));
} }
$attributes = $session->getAttributes(); $attributes = $session->getAttributes();
...@@ -186,13 +185,13 @@ try { ...@@ -186,13 +185,13 @@ try {
/* Authentication processing operations. */ /* Authentication processing operations. */
if (!isset($authProcState)) { if (!isset($authProcState)) {
/* Not processed. */ /* Not processed. */
$pc = new SimpleSAML_Auth_ProcessingChain($idpmetadata, $spmetadata, 'idp'); $pc = new SimpleSAML_Auth_ProcessingChain($idpmetadata, $spMetadata->toArray(), 'idp');
$authProcState = array( $authProcState = array(
'core:shib13-idp:requestcache' => $requestcache, 'core:shib13-idp:requestcache' => $requestcache,
'ReturnURL' => SimpleSAML_Utilities::selfURLNoQuery(), 'ReturnURL' => SimpleSAML_Utilities::selfURLNoQuery(),
'Attributes' => $attributes, 'Attributes' => $attributes,
'Destination' => $spmetadata, 'Destination' => $spMetadata->toArray(),
'Source' => $idpmetadata, 'Source' => $idpmetadata,
); );
...@@ -203,10 +202,10 @@ try { ...@@ -203,10 +202,10 @@ try {
/* Generate and send response. */ /* Generate and send response. */
$ar = new SimpleSAML_XML_Shib13_AuthnResponse(); $ar = new SimpleSAML_XML_Shib13_AuthnResponse();
$authnResponseXML = $ar->generate($idpmetadata, $spmetadata, $shire, $attributes); $authnResponseXML = $ar->generate($idpmetadata, $spMetadata->toArray(), $shire, $attributes);
$httppost = new SimpleSAML_Bindings_Shib13_HTTPPost($config, $metadata); $httppost = new SimpleSAML_Bindings_Shib13_HTTPPost($config, $metadata);
$httppost->sendResponse($authnResponseXML, $idpmetadata, $spmetadata, $requestcache['RelayState'], $shire); $httppost->sendResponse($authnResponseXML, $idpmetadata, $spMetadata->toArray(), $requestcache['RelayState'], $shire);
} catch(Exception $exception) { } catch(Exception $exception) {
SimpleSAML_Utilities::fatalError($session->getTrackID(), 'GENERATEAUTHNRESPONSE', $exception); SimpleSAML_Utilities::fatalError($session->getTrackID(), 'GENERATEAUTHNRESPONSE', $exception);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment