You are here

public function SamlController::logout in SAML Authentication 8.2

Same name and namespace in other branches
  1. 8.3 src/Controller/SamlController.php \Drupal\samlauth\Controller\SamlController::logout()
  2. 8 src/Controller/SamlController.php \Drupal\samlauth\Controller\SamlController::logout()
  3. 4.x src/Controller/SamlController.php \Drupal\samlauth\Controller\SamlController::logout()

Initiate a SAML2 logout flow.

This should redirect to the SLS service on the IDP and then to our SLS. It does not actually log us out (yet).

1 string reference to 'SamlController::logout'
samlauth.routing.yml in ./samlauth.routing.yml
samlauth.routing.yml

File

src/Controller/SamlController.php, line 124

Class

SamlController
Returns responses for samlauth module routes.

Namespace

Drupal\samlauth\Controller

Code

public function logout() {
  try {
    $url = $this->saml
      ->logout($this
      ->getUrlFromDestination());
  } catch (Exception $e) {
    $this
      ->handleException($e, 'initiating SAML logout');
    $url = Url::fromRoute('<front>');
  }
  return $this
    ->createRedirectResponse($url);
}