Aacotroneo\Saml2\Saml2Auth::acs PHP Method

acs() public method

Process a Saml response (assertion consumer service) When errors are encountered, it returns an array with proper description
public acs ( )
    function acs()
    {
        /** @var $auth OneLogin_Saml2_Auth */
        $auth = $this->auth;
        $auth->processResponse();
        $errors = $auth->getErrors();
        if (!empty($errors)) {
            return $errors;
        }
        if (!$auth->isAuthenticated()) {
            return array('error' => 'Could not authenticate');
        }
        return null;
    }

Usage Example

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