ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\HTTPArtifact Class Reference
+ Inheritance diagram for SAML2\HTTPArtifact:
+ Collaboration diagram for SAML2\HTTPArtifact:

Public Member Functions

 getRedirectURL (Message $message)
 Create the redirect URL for a message. More...
 
 send (Message $message)
 Send a SAML 2 message using the HTTP-Redirect binding. More...
 
 setSPMetadata (SimpleSAML_Configuration $sp)
 
- Public Member Functions inherited from SAML2\Binding
 getDestination ()
 Retrieve the destination of a message. More...
 
 setDestination ($destination)
 Override the destination of a message. More...
 
 send (Message $message)
 Send a SAML 2 message. More...
 
 receive ()
 Receive a SAML 2 message. More...
 

Static Public Member Functions

static validateSignature (ArtifactResponse $message, XMLSecurityKey $key)
 A validator which returns true if the ArtifactResponse was signed with the given key. More...
 
- Static Public Member Functions inherited from SAML2\Binding
static getBinding ($urn)
 Retrieve a binding with the given URN. More...
 
static getCurrentBinding ()
 Guess the current binding. More...
 

Private Attributes

 $spMetadata
 

Additional Inherited Members

- Protected Attributes inherited from SAML2\Binding
 $destination
 The destination of messages. More...
 

Detailed Description

Definition at line 20 of file HTTPArtifact.php.

Member Function Documentation

◆ getRedirectURL()

SAML2\HTTPArtifact::getRedirectURL ( Message  $message)

Create the redirect URL for a message.

Parameters
\SAML2\Message$messageThe message.
Returns
string The URL the user should be redirected to in order to send a message.
Exceptions

Definition at line 34 of file HTTPArtifact.php.

References $artifact, $params, $relayState, $store, SimpleSAML_Utilities\addURLparameter(), array, SimpleSAML_Utilities\generateRandomBytes(), SAML2\Message\getDestination(), SAML2\Message\getIssuer(), SAML2\Message\getRelayState(), SimpleSAML_Utilities\stringToHex(), and SAML2\Message\toUnsignedXML().

35  {
36  $store = SimpleSAML_Store::getInstance();
37  if ($store === false) {
38  throw new \Exception('Unable to send artifact without a datastore configured.');
39  }
40 
41  $generatedId = pack('H*', ((string) SimpleSAML_Utilities::stringToHex(SimpleSAML_Utilities::generateRandomBytes(20))));
42  $artifact = base64_encode("\x00\x04\x00\x00" . sha1($message->getIssuer(), true) . $generatedId) ;
43  $artifactData = $message->toUnsignedXML();
44  $artifactDataString = $artifactData->ownerDocument->saveXML($artifactData);
45 
46  $store->set('artifact', $artifact, $artifactDataString, Temporal::getTime() + 15*60);
47 
48  $params = array(
49  'SAMLart' => $artifact,
50  );
51  $relayState = $message->getRelayState();
52  if ($relayState !== null) {
53  $params['RelayState'] = $relayState;
54  }
55 
56  return SimpleSAML_Utilities::addURLparameter($message->getDestination(), $params);
57  }
$params
Definition: disable.php:11
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Definition: getUserInfo.php:11
static getTime()
Getter for getting the current timestamp.
Definition: Temporal.php:13
catch(Exception $e) $message
static generateRandomBytes($length)
Definition: Utilities.php:359
$relayState
Create styles array
The data for the language used.
static stringToHex($bytes)
Definition: Utilities.php:370
static addURLparameter($url, $parameters)
Definition: Utilities.php:99
+ Here is the call graph for this function:

◆ send()

SAML2\HTTPArtifact::send ( Message  $message)

Send a SAML 2 message using the HTTP-Redirect binding.

Note: This function never returns.

Parameters
\SAML2\Message$messageThe message we should send.

Definition at line 66 of file HTTPArtifact.php.

References $artifact, $artifactResponse, $destination, $endpoint, $idpMetadata, $sourceId, $xml, sspmod_saml_Message\addSign(), array, and SimpleSAML_Metadata_MetaDataStorageHandler\getMetadataHandler().

67  {
69  Utils::getContainer()->redirect($destination);
70  }
$destination
The destination of messages.
Definition: Binding.php:17
catch(Exception $e) $message
getRedirectURL(Message $message)
Create the redirect URL for a message.
static getContainer()
Definition: Utils.php:752
+ Here is the call graph for this function:

◆ setSPMetadata()

SAML2\HTTPArtifact::setSPMetadata ( SimpleSAML_Configuration  $sp)
Parameters
\SimpleSAML_Configuration$sp

Definition at line 154 of file HTTPArtifact.php.

155  {
156  $this->spMetadata = $sp;
157  }

◆ validateSignature()

static SAML2\HTTPArtifact::validateSignature ( ArtifactResponse  $message,
XMLSecurityKey  $key 
)
static

A validator which returns true if the ArtifactResponse was signed with the given key.

Parameters
\SAML2\ArtifactResponse$message
XMLSecurityKey$key
Returns
bool

Definition at line 166 of file HTTPArtifact.php.

References SAML2\Message\validate().

167  {
168  return $message->validate($key);
169  }
catch(Exception $e) $message
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

Field Documentation

◆ $spMetadata

SAML2\HTTPArtifact::$spMetadata
private

Definition at line 25 of file HTTPArtifact.php.


The documentation for this class was generated from the following file: