Definition at line 19 of file Artifact.php.
◆ buildRequest()
static SimpleSAML\Bindings\Shib13\Artifact::buildRequest |
( |
array |
$artifacts | ) |
|
|
staticprivate |
Build the request we will send to the IdP.
- Parameters
-
array | $artifacts | The artifacts we will request. |
- Returns
- string The request, as an XML string.
Definition at line 59 of file Artifact.php.
References SimpleSAML\Utils\Random\generateID(), and SimpleSAML\Utils\Time\generateTimestamp().
61 $msg =
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">' .
63 '<samlp:Request xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"' .
65 ' MajorVersion="1" MinorVersion="1"' .
69 foreach ($artifacts as $a) {
70 $msg .=
'<samlp:AssertionArtifact>' . htmlspecialchars($a) .
'</samlp:AssertionArtifact>';
73 $msg .=
'</samlp:Request>' .
75 '</SOAP-ENV:Envelope>';
static generateID()
Generate a random identifier, ID_LENGTH bytes long.
static generateTimestamp($instant=null)
This function generates a timestamp on the form used by the SAML protocols.
◆ extractResponse()
static SimpleSAML\Bindings\Shib13\Artifact::extractResponse |
( |
|
$soapResponse | ) |
|
|
staticprivate |
Extract the response element from the SOAP response.
- Parameters
-
string | $soapResponse | The SOAP response. |
- Returns
- string The <saml1p:Response> element, as a string.
- Exceptions
-
Definition at line 88 of file Artifact.php.
References $idpMetadata, $key, $request, $response, $spMetadata, $url, SAML2\DOMDocumentFactory\create(), SimpleSAML\Utils\XML\debugSAMLMessage(), SimpleSAML\Utils\HTTP\fetch(), SAML2\DOMDocumentFactory\fromString(), SimpleSAML\Utils\Config\getCertPath(), SimpleSAML_Configuration\getDefaultEndpoint(), SimpleSAML_Configuration\getPublicKeys(), SimpleSAML_Configuration\getString(), SimpleSAML\Utils\System\getTempDir(), SimpleSAML\Utils\XML\isDOMNodeOfType(), and SimpleSAML\Utils\System\writeFile().
90 assert(is_string($soapResponse));
95 throw new \SimpleSAML_Error_Exception(
'Error parsing SAML 1 artifact response.');
98 $soapEnvelope = $doc->firstChild;
99 if (!
XML::isDOMNodeOfType($soapEnvelope,
'Envelope',
'http://schemas.xmlsoap.org/soap/envelope/')) {
100 throw new \SimpleSAML_Error_Exception(
'Expected artifact response to contain a <soap:Envelope> element.');
103 $soapBody = XML::getDOMChildren($soapEnvelope,
'Body',
'http://schemas.xmlsoap.org/soap/envelope/');
104 if (count($soapBody) === 0) {
105 throw new \SimpleSAML_Error_Exception(
'Couldn\'t find <soap:Body> in <soap:Envelope>.');
107 $soapBody = $soapBody[0];
110 $responseElement = XML::getDOMChildren($soapBody,
'Response',
'urn:oasis:names:tc:SAML:1.0:protocol');
111 if (count($responseElement) === 0) {
112 throw new \SimpleSAML_Error_Exception(
'Couldn\'t find <saml1p:Response> in <soap:Body>.');
114 $responseElement = $responseElement[0];
121 $newDoc->appendChild($newDoc->importNode($responseElement,
true));
122 $responseXML = $newDoc->saveXML();
static isDOMNodeOfType(\DOMNode $element, $name, $nsURI)
This function checks if the DOMElement has the correct localName and namespaceURI.
◆ getArtifacts()
static SimpleSAML\Bindings\Shib13\Artifact::getArtifacts |
( |
| ) |
|
|
staticprivate |
Parse the query string, and extract the SAMLart parameters.
This function is required because each query contains multiple artifact with the same parameter name.
- Returns
- array The artifacts.
Definition at line 30 of file Artifact.php.
References $_SERVER, and $name.
32 assert(array_key_exists(
'QUERY_STRING',
$_SERVER));
38 $elements = explode(
'&',
$_SERVER[
'QUERY_STRING']);
39 foreach ($elements as $element) {
40 list(
$name, $value) = explode(
'=', $element, 2);
42 $value = urldecode($value);
44 if (
$name ===
'SAMLart') {
45 $artifacts[] = $value;
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/Artifact.php