runff 1.0 commit
This commit is contained in:
53
lib/SimpleSAML/XML/Shib13/AuthnRequest.php
Executable file
53
lib/SimpleSAML/XML/Shib13/AuthnRequest.php
Executable file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The Shibboleth 1.3 Authentication Request. Not part of SAML 1.1,
|
||||
* but an extension using query paramters no XML.
|
||||
*
|
||||
* @author Andreas Åkre Solberg, UNINETT AS. <andreas.solberg@uninett.no>
|
||||
* @package SimpleSAMLphp
|
||||
*/
|
||||
|
||||
namespace SimpleSAML\XML\Shib13;
|
||||
|
||||
class AuthnRequest
|
||||
{
|
||||
private $issuer = null;
|
||||
private $relayState = null;
|
||||
|
||||
public function setRelayState($relayState)
|
||||
{
|
||||
$this->relayState = $relayState;
|
||||
}
|
||||
|
||||
public function getRelayState()
|
||||
{
|
||||
return $this->relayState;
|
||||
}
|
||||
|
||||
public function setIssuer($issuer)
|
||||
{
|
||||
$this->issuer = $issuer;
|
||||
}
|
||||
public function getIssuer()
|
||||
{
|
||||
return $this->issuer;
|
||||
}
|
||||
|
||||
public function createRedirect($destination, $shire)
|
||||
{
|
||||
$metadata = \SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
|
||||
$idpmetadata = $metadata->getMetaDataConfig($destination, 'shib13-idp-remote');
|
||||
|
||||
$desturl = $idpmetadata->getDefaultEndpoint('SingleSignOnService', array('urn:mace:shibboleth:1.0:profiles:AuthnRequest'));
|
||||
$desturl = $desturl['Location'];
|
||||
|
||||
$target = $this->getRelayState();
|
||||
|
||||
$url = $desturl . '?' .
|
||||
'providerId=' . urlencode($this->getIssuer()) .
|
||||
'&shire=' . urlencode($shire) .
|
||||
(isset($target) ? '&target=' . urlencode($target) : '');
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user