You are here

public function SamlService::acs in SAML Authentication 8

Same name and namespace in other branches
  1. 8.3 src/SamlService.php \Drupal\samlauth\SamlService::acs()
  2. 8.2 src/SamlService.php \Drupal\samlauth\SamlService::acs()
  3. 4.x src/SamlService.php \Drupal\samlauth\SamlService::acs()

Process a SAML response (assertion consumer service)

Return value

array|null Returns array with error description on error. Null otherwise.

Throws

\OneLogin_Saml2_Error

File

src/SamlService.php, line 98
Contains Drupal\samlauth\SamlService.

Class

SamlService
Class SamlService.

Namespace

Drupal\samlauth

Code

public function acs() {
  $this->auth
    ->processResponse();
  $errors = $this->auth
    ->getErrors();
  if (!empty($errors)) {
    return $errors;
  }
  if (!$this
    ->isAuthenticated()) {
    return array(
      'error' => 'Could not authenticate.',
    );
  }
}