diff options
author | Olav Morken <olav.morken@uninett.no> | 2009-10-08 09:55:07 +0000 |
---|---|---|
committer | Olav Morken <olav.morken@uninett.no> | 2009-10-08 09:55:07 +0000 |
commit | 96e7c25ebbeca7f5ff896b8b5edb7ade09eefcc1 (patch) | |
tree | 168496d92bb287f64f864e3bee4ef94563b078db /lib/SimpleSAML/XML | |
parent | 6060813316864e7e7bbe8a02b4858d3e27ca3000 (diff) | |
download | simplesamlphp-96e7c25ebbeca7f5ff896b8b5edb7ade09eefcc1.zip simplesamlphp-96e7c25ebbeca7f5ff896b8b5edb7ade09eefcc1.tar.gz simplesamlphp-96e7c25ebbeca7f5ff896b8b5edb7ade09eefcc1.tar.bz2 |
saml: Add SAML 1 artifact support.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1830 44740490-163a-0410-bde0-09ae8108e29a
Diffstat (limited to 'lib/SimpleSAML/XML')
-rw-r--r-- | lib/SimpleSAML/XML/Shib13/AuthnResponse.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php index e438020..5a3ba14 100644 --- a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php +++ b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php @@ -15,6 +15,14 @@ class SimpleSAML_XML_Shib13_AuthnResponse { private $validator = null; + /** + * Whether this response was validated by some external means (e.g. SSL). + * + * @var bool + */ + private $messageValidated = FALSE; + + const SHIB_PROTOCOL_NS = 'urn:oasis:names:tc:SAML:1.0:protocol'; const SHIB_ASSERT_NS = 'urn:oasis:names:tc:SAML:1.0:assertion'; @@ -34,6 +42,18 @@ class SimpleSAML_XML_Shib13_AuthnResponse { private $relayState = null; + /** + * Set whether this message was validated externally. + * + * @param bool $messageValidated TRUE if the message is already validated, FALSE if not. + */ + public function setMessageValidated($messageValidated) { + assert('is_bool($messageValidated)'); + + $this->messageValidated = $messageValidated; + } + + public function setXML($xml) { assert('is_string($xml)'); @@ -55,6 +75,11 @@ class SimpleSAML_XML_Shib13_AuthnResponse { public function validate() { assert('$this->dom instanceof DOMDocument'); + if ($this->messageValidated) { + /* This message was validated externally. */ + return TRUE; + } + /* Validate the signature. */ $this->validator = new SimpleSAML_XML_Validator($this->dom, array('ResponseID', 'AssertionID')); @@ -90,6 +115,11 @@ class SimpleSAML_XML_Shib13_AuthnResponse { */ private function isNodeValidated($node) { + if ($this->messageValidated) { + /* This message was validated externally. */ + return TRUE; + } + if($this->validator === NULL) { return FALSE; } |