Skip to content

Commit 9ba5afd

Browse files
author
Boy Baukema
committed
Improved exception messages
1 parent 20206b3 commit 9ba5afd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/OneLogin/Saml/XmlSec.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,29 +74,30 @@ public function isValid()
7474

7575
$objDSig = $objXMLSecDSig->locateSignature($this->_document);
7676
if (!$objDSig) {
77-
throw new Exception("Cannot locate Signature Node");
77+
throw new Exception('Cannot locate Signature Node');
7878
}
7979
$objXMLSecDSig->canonicalizeSignedInfo();
8080
$objXMLSecDSig->idKeys = array('ID');
8181

8282
$retVal = $objXMLSecDSig->validateReference();
8383
if (!$retVal) {
84-
throw new Exception("Reference Validation Failed");
84+
throw new Exception('Reference Validation Failed');
8585
}
8686

8787
$singleAssertion = $this->validateNumAssertions();
8888
if (!$singleAssertion) {
89-
throw new Exception("Only one SAMLAssertion allowed");
89+
throw new Exception('Multiple assertions are not supported');
9090
}
9191

9292
$validTimestamps = $this->validateTimestamps();
9393
if (!$validTimestamps) {
94-
throw new Exception("SAMLAssertion conditions not met");
94+
throw new Exception('Timing issues (please check your clock settings)
95+
');
9596
}
9697

9798
$objKey = $objXMLSecDSig->locateKey();
9899
if (!$objKey) {
99-
throw new Exception("We have no idea about the key");
100+
throw new Exception('We have no idea about the key');
100101
}
101102

102103
XMLSecEnc::staticLocateKeyInfo($objKey, $objDSig);

0 commit comments

Comments
 (0)