You are here

public function SamlController::changepw in SAML Authentication 8.3

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

Redirects to the 'Change Password' service.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse The HTTP response to send back.

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

File

src/Controller/SamlController.php, line 299

Class

SamlController
Returns responses for samlauth module routes.

Namespace

Drupal\samlauth\Controller

Code

public function changepw() {
  $function = function () {
    $url = $this
      ->config(self::CONFIG_OBJECT_NAME)
      ->get('idp_change_password_service');
    if (!$url) {
      throw new UserVisibleException("Change password service is not available.");
    }
    return $url;
  };

  // This response is cached. (We should probably clear it from the cache
  // when the configuration is changed. On a half related note: we should
  // probably also have at least one 'user story' or other note about this
  // endpoint. The current reason for this only being available for logged-in
  // users is "v1 did it this way and there has been no reason/request to
  // change it" but we don't know if this is generally applicable for IdPs.)
  return $this
    ->getTrustedRedirectResponse($function, '', '<front>');
}