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

SimpleSAML_XML_Shib13/AuthnRequest: Remove $configuratio nand $metadatastore...

SimpleSAML_XML_Shib13/AuthnRequest: Remove $configuratio nand $metadatastore parameters from constructor.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1689 44740490-163a-0410-bde0-09ae8108e29a
parent bc620d4a
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
*/ */
class SimpleSAML_XML_Shib13_AuthnRequest { class SimpleSAML_XML_Shib13_AuthnRequest {
private $configuration = null;
private $metadata = null; private $metadata = null;
private $issuer = null; private $issuer = null;
...@@ -23,9 +22,7 @@ class SimpleSAML_XML_Shib13_AuthnRequest { ...@@ -23,9 +22,7 @@ class SimpleSAML_XML_Shib13_AuthnRequest {
const PROTOCOL = 'shib13'; const PROTOCOL = 'shib13';
function __construct(SimpleSAML_Configuration $configuration, SimpleSAML_Metadata_MetaDataStorageHandler $metadatastore) { function __construct() {
$this->configuration = $configuration;
$this->metadata = $metadatastore;
$this->requestid = SimpleSAML_Utilities::generateID(); $this->requestid = SimpleSAML_Utilities::generateID();
} }
...@@ -76,16 +73,19 @@ class SimpleSAML_XML_Shib13_AuthnRequest { ...@@ -76,16 +73,19 @@ class SimpleSAML_XML_Shib13_AuthnRequest {
} }
public function createRedirect($destination) { public function createRedirect($destination, $shire = NULL) {
$idpmetadata = $this->metadata->getMetaData($destination, 'shib13-idp-remote'); $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
$spmetadata = $this->metadata->getMetaData($this->getIssuer(), 'shib13-sp-hosted'); $idpmetadata = $metadata->getMetaData($destination, 'shib13-idp-remote');
if ($shire === NULL) {
$shire = $metadata->getGenerated('AssertionConsumerService', 'shib13-sp-hosted');
}
if (!isset($idpmetadata['SingleSignOnService'])) { if (!isset($idpmetadata['SingleSignOnService'])) {
throw new Exception('Could not find the SingleSignOnService parameter in the Shib 1.3 IdP Remote metadata. This parameter has changed name from an earlier version of simpleSAMLphp, when it was called SingleSignOnUrl. Please check your shib13-sp-remote.php configuration the IdP with entity id ' . $destination . ' and make sure the SingleSignOnService parameter is set.'); throw new Exception('Could not find the SingleSignOnService parameter in the Shib 1.3 IdP Remote metadata. This parameter has changed name from an earlier version of simpleSAMLphp, when it was called SingleSignOnUrl. Please check your shib13-sp-remote.php configuration the IdP with entity id ' . $destination . ' and make sure the SingleSignOnService parameter is set.');
} }
$desturl = $idpmetadata['SingleSignOnService']; $desturl = $idpmetadata['SingleSignOnService'];
$shire = $this->metadata->getGenerated('AssertionConsumerService', 'shib13-sp-hosted');
$target = $this->getRelayState(); $target = $this->getRelayState();
$url = $desturl . '?' . $url = $desturl . '?' .
......
...@@ -67,7 +67,7 @@ if (!isset($session) || !$session->isValid('shib13') ) { ...@@ -67,7 +67,7 @@ if (!isset($session) || !$session->isValid('shib13') ) {
try { try {
$ar = new SimpleSAML_XML_Shib13_AuthnRequest($config, $metadata); $ar = new SimpleSAML_XML_Shib13_AuthnRequest();
$ar->setIssuer($spentityid); $ar->setIssuer($spentityid);
if(isset($_GET['RelayState'])) if(isset($_GET['RelayState']))
$ar->setRelayState($_GET['RelayState']); $ar->setRelayState($_GET['RelayState']);
......
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