Aacotroneo\Saml2\Saml2Auth::sls PHP Method

sls() public method

Process a Saml response (assertion consumer service) returns an array with errors if it can not logout
public sls ( $retrieveParametersFromServer = false )
    function sls($retrieveParametersFromServer = false)
    {
        $auth = $this->auth;
        // destroy the local session by firing the Logout event
        $keep_local_session = false;
        $session_callback = function () {
            event(new Saml2LogoutEvent());
        };
        $auth->processSLO($keep_local_session, null, $retrieveParametersFromServer, $session_callback);
        $errors = $auth->getErrors();
        return $errors;
    }

Usage Example

Example #1
0
 public function testSlsOK()
 {
     $auth = m::mock('OneLogin_Saml2_Auth');
     $saml2 = new Saml2Auth($auth);
     $auth->shouldReceive('processSLO')->once()->with(true);
     $auth->shouldReceive('getErrors')->once()->andReturn(null);
     $error = $saml2->sls();
     $this->assertEmpty($error);
 }
All Usage Examples Of Aacotroneo\Saml2\Saml2Auth::sls