diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/SAML2/Const.php | 39 | ||||
-rw-r--r-- | lib/SimpleSAML/XML/SAML20/AuthnResponse.php | 6 |
2 files changed, 42 insertions, 3 deletions
diff --git a/lib/SAML2/Const.php b/lib/SAML2/Const.php new file mode 100644 index 0000000..896872d --- /dev/null +++ b/lib/SAML2/Const.php @@ -0,0 +1,39 @@ +<?php + +/** + * Various SAML 2 constants. + * + * @package simpleSAMLphp + * @version $Id$ + */ +class SAML2_Const { + + /** + * Top-level status code indicating successful processing of the request. + */ + const STATUS_SUCCESS = 'urn:oasis:names:tc:SAML:2.0:status:Success'; + + /** + * Top-level status code indicating that there was a problem with the request. + */ + const STATUS_REQUESTER = 'urn:oasis:names:tc:SAML:2.0:status:Requester'; + + /** + * Top-level status code indicating that there was a problem generating the response. + */ + const STATUS_RESPONDER = 'urn:oasis:names:tc:SAML:2.0:status:Responder'; + + /** + * Top-level status code indicating that the request was from an unsupported version of the SAML protocol. + */ + const STATUS_VERSION_MISMATCH = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch'; + + + /** + * Second-level status code for NoPassive errors. + */ + const STATUS_NO_PASSIVE = 'urn:oasis:names:tc:SAML:2.0:status:NoPassive'; + +} + +?>
\ No newline at end of file diff --git a/lib/SimpleSAML/XML/SAML20/AuthnResponse.php b/lib/SimpleSAML/XML/SAML20/AuthnResponse.php index 32ee3aa..0c38b82 100644 --- a/lib/SimpleSAML/XML/SAML20/AuthnResponse.php +++ b/lib/SimpleSAML/XML/SAML20/AuthnResponse.php @@ -676,10 +676,10 @@ class SimpleSAML_XML_SAML20_AuthnResponse extends SimpleSAML_XML_AuthnResponse { if (is_string($status)) { if ($status === 'Success') { /* Not really an error, but it makes the code simpler. */ - $status = new sspmod_saml2_Error(sspmod_saml2_Const::STATUS_SUCCESS); + $status = new sspmod_saml2_Error(SAML2_Const::STATUS_SUCCESS); } else { $status = new sspmod_saml2_Error( - sspmod_saml2_Const::STATUS_RESPONDER, + SAML2_Const::STATUS_RESPONDER, 'urn:oasis:names:tc:SAML:2.0:status:' . $status ); } @@ -763,7 +763,7 @@ class SimpleSAML_XML_SAML20_AuthnResponse extends SimpleSAML_XML_AuthnResponse { if (!empty($inresponseto)) $inresponsetoText = 'InResponseTo="' . htmlspecialchars($inresponseto). '" '; $assertion = ""; - if ($status->getStatus() === sspmod_saml2_Const::STATUS_SUCCESS) { + if ($status->getStatus() === SAML2_Const::STATUS_SUCCESS) { $assertion = '<saml:Assertion Version="2.0" ID="' . $assertionid . '" IssueInstant="' . $issueInstant . '"> <saml:Issuer>' . htmlspecialchars($issuer) . '</saml:Issuer> |