Revision: 1909 Author: olavmrk Date: Mon Oct 26 07:54:59 2009 Log: saml: Make it possible to go back to the discovery service page after starting SSO.
Fixes issue 230 Merged into 1.5 branch from r1900. http://code.google.com/p/simplesamlphp/source/detail?r=1909 Modified: /branches/simplesamlphp-1.5/modules/saml/lib/Auth/Source/SP.php /branches/simplesamlphp-1.5/modules/saml/www/sp/discoresp.php /branches/simplesamlphp-1.5/modules/saml/www/sp/saml1-acs.php /branches/simplesamlphp-1.5/modules/saml/www/sp/saml2-acs.php ======================================= --- /branches/simplesamlphp-1.5/modules/saml/lib/Auth/Source/SP.php Sun Oct 11 23:48:44 2009 +++ /branches/simplesamlphp-1.5/modules/saml/lib/Auth/Source/SP.php Mon Oct 26 07:54:59 2009 @@ -146,7 +146,7 @@ $ar = new SimpleSAML_XML_Shib13_AuthnRequest(); $ar->setIssuer($this->entityId); - $id = SimpleSAML_Auth_State::saveState($state, 'saml:sp:ssosent-saml1'); + $id = SimpleSAML_Auth_State::saveState($state, 'saml:sp:sso'); $ar->setRelayState($id); $useArtifact = $idpMetadata->getBoolean('saml1.useartifact', NULL); @@ -185,7 +185,7 @@ $ar->setRelayState($state['SimpleSAML_Auth_Default.ReturnURL']); } - $id = SimpleSAML_Auth_State::saveState($state, 'saml:sp:ssosent-saml2'); + $id = SimpleSAML_Auth_State::saveState($state, 'saml:sp:sso'); $ar->setId($id); $b = new SAML2_HTTPRedirect(); @@ -229,7 +229,7 @@ */ private function startDisco(array $state) { - $id = SimpleSAML_Auth_State::saveState($state, 'saml:disco'); + $id = SimpleSAML_Auth_State::saveState($state, 'saml:sp:sso'); $config = SimpleSAML_Configuration::getInstance(); ======================================= --- /branches/simplesamlphp-1.5/modules/saml/www/sp/discoresp.php Wed Aug 19 01:31:19 2009 +++ /branches/simplesamlphp-1.5/modules/saml/www/sp/discoresp.php Mon Oct 26 07:54:59 2009 @@ -12,7 +12,7 @@ throw new SimpleSAML_Error_BadRequest('Missing idpentityid to discovery service response handler'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthID'], 'saml:disco'); +$state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthID'], 'saml:sp:sso'); /* Find authentication source. */ assert('array_key_exists("saml:sp:AuthId", $state)'); ======================================= --- /branches/simplesamlphp-1.5/modules/saml/www/sp/saml1-acs.php Thu Oct 8 02:55:07 2009 +++ /branches/simplesamlphp-1.5/modules/saml/www/sp/saml1-acs.php Mon Oct 26 07:54:59 2009 @@ -18,7 +18,7 @@ $source = SimpleSAML_Auth_Source::getById($sourceId, 'sspmod_saml_Auth_Source_SP'); -$state = SimpleSAML_Auth_State::loadState($_REQUEST['TARGET'], 'saml:sp:ssosent-saml1'); +$state = SimpleSAML_Auth_State::loadState($_REQUEST['TARGET'], 'saml:sp:sso'); /* Check that the authentication source is correct. */ assert('array_key_exists("saml:sp:AuthId", $state)'); @@ -26,6 +26,12 @@ throw new SimpleSAML_Error_Exception('The authentication source id in the URL does not match the authentication source which sent the request.'); } +if (!isset($state['saml:idp'])) { + /* We seem to have received a response without sending a request. */ + throw new SimpleSAML_Error_Exception('SAML 1 response received before SAML 1 request.'); +} + + $spMetadata = $source->getMetadata(); $idpEntityId = $state['saml:idp']; ======================================= --- /branches/simplesamlphp-1.5/modules/saml/www/sp/saml2-acs.php Thu Oct 1 04:45:08 2009 +++ /branches/simplesamlphp-1.5/modules/saml/www/sp/saml2-acs.php Mon Oct 26 07:54:59 2009 @@ -16,7 +16,7 @@ $stateId = $response->getInResponseTo(); if (!empty($stateId)) { /* This is a response to a request we sent earlier. */ - $state = SimpleSAML_Auth_State::loadState($stateId, 'saml:sp:ssosent-saml2'); + $state = SimpleSAML_Auth_State::loadState($stateId, 'saml:sp:sso'); /* Check that the authentication source is correct. */ assert('array_key_exists("saml:sp:AuthId", $state)'); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "simpleSAMLphp commits" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simplesamlphp-commits?hl=en -~----------~----~----~----~------~----~------~--~---
