You are here

public function ForceLoginController::forceLogin in CAS 8

Same name and namespace in other branches
  1. 2.x src/Controller/ForceLoginController.php \Drupal\cas\Controller\ForceLoginController::forceLogin()

Handles a page request for our forced login route.

1 string reference to 'ForceLoginController::forceLogin'
cas.routing.yml in ./cas.routing.yml
cas.routing.yml

File

src/Controller/ForceLoginController.php, line 55

Class

ForceLoginController
Class ForceLoginController.

Namespace

Drupal\cas\Controller

Code

public function forceLogin() {

  // TODO: What if CAS is not configured? need to handle that case.
  $service_url_query_params = $this->requestStack
    ->getCurrentRequest()->query
    ->all();
  $cas_redirect_data = new CasRedirectData($service_url_query_params);
  $cas_redirect_data
    ->setIsCacheable(TRUE);
  return $this->casRedirector
    ->buildRedirectResponse($cas_redirect_data, TRUE);
}