You are here

class FailedAuthenticationEvent in Social Auth 8.2

Same name and namespace in other branches
  1. 3.x src/Event/FailedAuthenticationEvent.php \Drupal\social_auth\Event\FailedAuthenticationEvent

Dispatched when user authentication fails in provider.

Hierarchy

Expanded class hierarchy of FailedAuthenticationEvent

See also

\Drupal\social_auth\Event\SocialAuthEvents

1 file declares its use of FailedAuthenticationEvent
UserAuthenticator.php in src/User/UserAuthenticator.php

File

src/Event/FailedAuthenticationEvent.php, line 14

Namespace

Drupal\social_auth\Event
View source
class FailedAuthenticationEvent extends Event {

  /**
   * The Social Auth data handler.
   *
   * @var \Drupal\social_auth\SocialAuthDataHandler
   */
  protected $dataHandler;

  /**
   * The plugin id dispatching this event.
   *
   * @var string
   */
  protected $pluginId;

  /**
   * The error string.
   *
   * @var string
   */
  protected $error;

  /**
   * RedirectResponse object.
   *
   * @var \Symfony\Component\HttpFoundation\RedirectResponse
   */
  protected $response;

  /**
   * FailedAuthenticationEvent constructor.
   *
   * @param \Drupal\social_auth\SocialAuthDataHandler $data_handler
   *   The Social Auth data handler.
   * @param string $plugin_id
   *   The plugin Id dispatching this event.
   * @param string $error
   *   The error string.
   */
  public function __construct(SocialAuthDataHandler $data_handler, $plugin_id, $error = NULL) {
    $this->dataHandler = $data_handler;
    $this->pluginId = $plugin_id;
    $this->error = $error;
  }

  /**
   * Gets the Social Auth data handler object.
   *
   * @return \Drupal\social_auth\SocialAuthDataHandler
   *   The Social Auth data handler.
   */
  public function getDataHandler() {
    return $this->dataHandler;
  }

  /**
   * Gets the plugin id dispatching this event.
   *
   * @return string
   *   The plugin id.
   */
  public function getPluginId() {
    return $this->pluginId;
  }

  /**
   * Gets the error string from provider.
   *
   * @return string
   *   The error string.
   */
  public function getError() {
    return $this->error;
  }

  /**
   * Returns the current redirect response object.
   *
   * @return \Symfony\Component\HttpFoundation\Response
   *   The response from the provider.
   */
  public function getResponse() {
    return $this->response;
  }

  /**
   * Sets a new redirect response object.
   *
   * @param \Symfony\Component\HttpFoundation\RedirectResponse $response
   *   The response from the provider.
   */
  public function setResponse(RedirectResponse $response) {
    $this->response = $response;
  }

  /**
   * Returns whether a redirect response was set.
   *
   * @return bool
   *   Whether a response was set.
   */
  public function hasResponse() {
    return $this->response !== NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FailedAuthenticationEvent::$dataHandler protected property The Social Auth data handler.
FailedAuthenticationEvent::$error protected property The error string.
FailedAuthenticationEvent::$pluginId protected property The plugin id dispatching this event.
FailedAuthenticationEvent::$response protected property RedirectResponse object.
FailedAuthenticationEvent::getDataHandler public function Gets the Social Auth data handler object.
FailedAuthenticationEvent::getError public function Gets the error string from provider.
FailedAuthenticationEvent::getPluginId public function Gets the plugin id dispatching this event.
FailedAuthenticationEvent::getResponse public function Returns the current redirect response object.
FailedAuthenticationEvent::hasResponse public function Returns whether a redirect response was set.
FailedAuthenticationEvent::setResponse public function Sets a new redirect response object.
FailedAuthenticationEvent::__construct public function FailedAuthenticationEvent constructor.