@@ -137,6 +137,8 @@ class OneLogin_Saml2_Auth
137137 * Initializes the SP SAML instance.
138138 *
139139 * @param array|object|null $oldSettings Setting data (You can provide a OneLogin_Saml_Settings, the settings object of the Saml folder implementation)
140+ *
141+ * @throws OneLogin_Saml2_Error
140142 */
141143 public function __construct ($ oldSettings = null )
142144 {
@@ -157,11 +159,12 @@ public function getSettings()
157159 * Set the strict mode active/disable
158160 *
159161 * @param bool $value Strict parameter
162+ *
160163 * @throws OneLogin_Saml2_Error
161164 */
162165 public function setStrict ($ value )
163166 {
164- if (! ( is_bool ($ value) )) {
167+ if (!is_bool ($ value )) {
165168 throw new OneLogin_Saml2_Error (
166169 'Invalid value passed to setStrict() ' ,
167170 OneLogin_Saml2_Error::SETTINGS_INVALID_SYNTAX
@@ -177,12 +180,13 @@ public function setStrict($value)
177180 * @param string|null $requestId The ID of the AuthNRequest sent by this SP to the IdP
178181 *
179182 * @throws OneLogin_Saml2_Error
183+ * @throws OneLogin_Saml2_ValidationError
180184 */
181185 public function processResponse ($ requestId = null )
182186 {
183187 $ this ->_errors = array ();
184188 $ this ->_errorReason = null ;
185- if (isset ($ _POST ) && isset ( $ _POST ['SAMLResponse ' ])) {
189+ if (isset ($ _POST ['SAMLResponse ' ])) {
186190 // AuthnResponse -- HTTP_POST Binding
187191 $ response = new OneLogin_Saml2_Response ($ this ->_settings , $ _POST ['SAMLResponse ' ]);
188192 $ this ->_lastResponse = $ response ->getXMLDocument ();
@@ -229,7 +233,7 @@ public function processSLO($keepLocalSession = false, $requestId = null, $retrie
229233 {
230234 $ this ->_errors = array ();
231235 $ this ->_errorReason = null ;
232- if (isset ($ _GET ) && isset ( $ _GET ['SAMLResponse ' ])) {
236+ if (isset ($ _GET ['SAMLResponse ' ])) {
233237 $ logoutResponse = new OneLogin_Saml2_LogoutResponse ($ this ->_settings , $ _GET ['SAMLResponse ' ]);
234238 $ this ->_lastResponse = $ logoutResponse ->getXML ();
235239 if (!$ logoutResponse ->isValid ($ requestId , $ retrieveParametersFromServer )) {
@@ -247,7 +251,7 @@ public function processSLO($keepLocalSession = false, $requestId = null, $retrie
247251 }
248252 }
249253 }
250- } else if (isset ($ _GET ) && isset ( $ _GET ['SAMLRequest ' ])) {
254+ } else if (isset ($ _GET ['SAMLRequest ' ])) {
251255 $ logoutRequest = new OneLogin_Saml2_LogoutRequest ($ this ->_settings , $ _GET ['SAMLRequest ' ]);
252256 $ this ->_lastRequest = $ logoutRequest ->getXML ();
253257 if (!$ logoutRequest ->isValid ($ retrieveParametersFromServer )) {
@@ -296,10 +300,13 @@ public function processSLO($keepLocalSession = false, $requestId = null, $retrie
296300 * Redirects the user to the url past by parameter
297301 * or to the url that we defined in our SSO Request.
298302 *
299- * @param string $url The target URL to redirect the user.
300- * @param array $parameters Extra parameters to be passed as part of the url
301- * @param bool $stay True if we want to stay (returns the url string) False to redirect
303+ * @param string $url The target URL to redirect the user.
304+ * @param array $parameters Extra parameters to be passed as part of the url
305+ * @param bool $stay True if we want to stay (returns the url string) False to redirect
306+ *
302307 * @return string|null
308+ *
309+ * @throws OneLogin_Saml2_Error
303310 */
304311 public function redirectTo ($ url = '' , $ parameters = array (), $ stay = false )
305312 {
@@ -452,14 +459,16 @@ public function getAttributeWithFriendlyName($friendlyName)
452459 /**
453460 * Initiates the SSO process.
454461 *
455- * @param string|null $returnTo The target URL the user should be returned to after login.
456- * @param array $parameters Extra parameters to be added to the GET
457- * @param bool $forceAuthn When true the AuthNRequest will set the ForceAuthn='true'
458- * @param bool $isPassive When true the AuthNRequest will set the Ispassive='true'
459- * @param bool $stay True if we want to stay (returns the url string) False to redirect
460- * @param bool $setNameIdPolicy When true the AuthNRueqest will set a nameIdPolicy element
462+ * @param string|null $returnTo The target URL the user should be returned to after login.
463+ * @param array $parameters Extra parameters to be added to the GET
464+ * @param bool $forceAuthn When true the AuthNRequest will set the ForceAuthn='true'
465+ * @param bool $isPassive When true the AuthNRequest will set the Ispassive='true'
466+ * @param bool $stay True if we want to stay (returns the url string) False to redirect
467+ * @param bool $setNameIdPolicy When true the AuthNRueqest will set a nameIdPolicy element
461468 *
462469 * @return string|null If $stay is True, it return a string with the SLO URL + LogoutRequest + parameters
470+ *
471+ * @throws OneLogin_Saml2_Error
463472 */
464473 public function login ($ returnTo = null , $ parameters = array (), $ forceAuthn = false , $ isPassive = false , $ stay = false , $ setNameIdPolicy = true )
465474 {
@@ -591,7 +600,6 @@ public function getLastRequestID()
591600 *
592601 * @return string A base64 encoded signature
593602 *
594- * @throws Exception
595603 * @throws OneLogin_Saml2_Error
596604 */
597605 public function buildRequestSignature ($ samlRequest , $ relayState , $ signAlgorithm = XMLSecurityKey::RSA_SHA1 )
@@ -634,7 +642,6 @@ public function buildRequestSignature($samlRequest, $relayState, $signAlgorithm
634642 *
635643 * @return string A base64 encoded signature
636644 *
637- * @throws Exception
638645 * @throws OneLogin_Saml2_Error
639646 */
640647 public function buildResponseSignature ($ samlResponse , $ relayState , $ signAlgorithm = XMLSecurityKey::RSA_SHA1 )
0 commit comments