You are here

class Auth0UserSigninEvent in Auth0 Single Sign On 8.2

Same name and namespace in other branches
  1. 8 src/Event/Auth0UserSigninEvent.php \Drupal\auth0\Event\Auth0UserSigninEvent

User signin event.

Hierarchy

Expanded class hierarchy of Auth0UserSigninEvent

1 file declares its use of Auth0UserSigninEvent
AuthController.php in src/Controller/AuthController.php
Contains \Drupal\auth0\Controller\AuthController.

File

src/Event/Auth0UserSigninEvent.php, line 11

Namespace

Drupal\auth0\Event
View source
class Auth0UserSigninEvent extends Event {

  /**
   * The event name.
   */
  const NAME = 'auth0.signin';

  /**
   * The current user.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $user;

  /**
   * The Auth0 profile.
   *
   * @var array
   */
  protected $auth0Profile;

  /**
   * The refresh token.
   *
   * @var string
   */
  protected $refreshToken;

  /**
   * The timestamp when the token expires.
   *
   * @var timestamp
   */
  protected $expiresAt;

  /**
   * Initialize the event.
   *
   * @param \Drupal\user\UserInterface $user
   *   The current user.
   * @param array $auth0Profile
   *   The Auth0 profile array.
   * @param string $refreshToken
   *   The refresh token.
   * @param string $expiresAt
   *   The time when the ID Token expires in unix timestamp (seconds only).
   */
  public function __construct(UserInterface $user, array $auth0Profile, $refreshToken, $expiresAt) {
    $this->user = $user;
    $this->auth0Profile = $auth0Profile;
    $this->refreshToken = $refreshToken;
    $this->expiresAt = $expiresAt;
  }

  /**
   * Get the Drupal user.
   *
   * @return \Drupal\user\UserInterface
   *   The current user.
   */
  public function getUser() {
    return $this->user;
  }

  /**
   * Get the Auth0 profile.
   *
   * @return array
   *   The Auth0 profile array.
   */
  public function getAuth0Profile() {
    return $this->auth0Profile;
  }

  /**
   * Get the refresh token.
   *
   * @return string
   *   The refresh token.
   */
  public function getRefreshToken() {
    return $this->refreshToken;
  }

  /**
   * Get the time when the ID token expires.
   *
   * @return timestamp
   *   The unix time when token expires.
   */
  public function getExpiresAt() {
    return $this->expiresAt;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Auth0UserSigninEvent::$auth0Profile protected property The Auth0 profile.
Auth0UserSigninEvent::$expiresAt protected property The timestamp when the token expires.
Auth0UserSigninEvent::$refreshToken protected property The refresh token.
Auth0UserSigninEvent::$user protected property The current user.
Auth0UserSigninEvent::getAuth0Profile public function Get the Auth0 profile.
Auth0UserSigninEvent::getExpiresAt public function Get the time when the ID token expires.
Auth0UserSigninEvent::getRefreshToken public function Get the refresh token.
Auth0UserSigninEvent::getUser public function Get the Drupal user.
Auth0UserSigninEvent::NAME constant The event name.
Auth0UserSigninEvent::__construct public function Initialize the event.