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

SAML2:AuthnResponse - Added getInResponseTo() method to get the InResponseTo...

SAML2:AuthnResponse - Added getInResponseTo() method to get the InResponseTo attribute of the response-element.


git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@116 44740490-163a-0410-bde0-09ae8108e29a
parent 60a739d2
No related branches found
No related tags found
No related merge requests found
...@@ -337,7 +337,35 @@ class SimpleSAML_XML_SAML20_AuthnResponse extends SimpleSAML_XML_AuthnResponse { ...@@ -337,7 +337,35 @@ class SimpleSAML_XML_SAML20_AuthnResponse extends SimpleSAML_XML_AuthnResponse {
//echo '<pre>'; print_r($nameID); echo '</pre>'; //echo '<pre>'; print_r($nameID); echo '</pre>';
return $nameID; return $nameID;
} }
/* This function retrieves the ID of the request this response is a
* response to. This ID is stored in the InResponseTo attribute of the
* top level DOM element.
*
* Returns:
* The ID of the request this response is a response to, or NULL if
* we don't know.
*/
public function getInResponseTo() {
$dom = $this->getDOM();
if($dom === NULL) {
return NULL;
}
assert('$dom instanceof DOMDocument');
$xPath = new DOMXpath($dom);
$xPath->registerNamespace('samlp', 'urn:oasis:names:tc:SAML:2.0:protocol');
$result = $xPath->query('/samlp:Response/@InResponseTo');
if($result->length === 0) {
return NULL;
}
return $result->item(0)->value;
}
// Not updated for response. from request. // Not updated for response. from request.
public function generate($idpentityid, $spentityid, $inresponseto, $nameid, $attributes) { public function generate($idpentityid, $spentityid, $inresponseto, $nameid, $attributes) {
......
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