class JwtAuthValidateEvent in JSON Web Token Authentication (JWT) 8.0
Same name and namespace in other branches
- 8 src/Authentication/Event/JwtAuthValidateEvent.php \Drupal\jwt\Authentication\Event\JwtAuthValidateEvent
Class JwtAuthValidateEvent.
@package Drupal\jwt\Authentication\Event
Hierarchy
- class \Drupal\jwt\Authentication\Event\JwtAuthBaseEvent extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\jwt\Authentication\Event\JwtAuthValidateEvent
Expanded class hierarchy of JwtAuthValidateEvent
2 files declare their use of JwtAuthValidateEvent
- JwtAuth.php in src/
Authentication/ Provider/ JwtAuth.php - JwtAuthConsumerSubscriber.php in modules/
jwt_auth_consumer/ src/ EventSubscriber/ JwtAuthConsumerSubscriber.php
File
- src/
Authentication/ Event/ JwtAuthValidateEvent.php, line 10
Namespace
Drupal\jwt\Authentication\EventView source
class JwtAuthValidateEvent extends JwtAuthBaseEvent {
/**
* Variable tracking whether a token has been marked invalid.
*
* @var bool
*/
protected $valid = TRUE;
/**
* Variable holding a reason that a token was marked invalid.
*
* @var string
*/
protected $invalidReason;
/**
* Marks a token as invalid and stops further propagation of the event.
*
* This marks a given token as invalid. You should provide a reason for
* invalidating the token. This message will not be kept private, so one
* should be cautious of leaking secure information here.
*
* @param string $reason
* The reason that this token was invalidated.
*/
public function invalidate($reason) {
$this->valid = FALSE;
$this->invalidReason = $reason;
$this
->stopPropagation();
}
/**
* Returns whether a token was considered valid.
*
* @return bool
* Returns if the token is valid.
*/
public function isValid() {
return $this->valid;
}
/**
* Returns a string describing why a JWT was considered invalid.
*
* @return string
* The reason the token is invalid.
*/
public function invalidReason() {
return $this->invalidReason;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JwtAuthBaseEvent:: |
protected | property | The JsonWebToken. | |
JwtAuthBaseEvent:: |
public | function | Returns the JWT. | |
JwtAuthBaseEvent:: |
public | function | Constructs a JwtAuthEvent with a JsonWebToken. | 1 |
JwtAuthValidateEvent:: |
protected | property | Variable holding a reason that a token was marked invalid. | |
JwtAuthValidateEvent:: |
protected | property | Variable tracking whether a token has been marked invalid. | |
JwtAuthValidateEvent:: |
public | function | Marks a token as invalid and stops further propagation of the event. | |
JwtAuthValidateEvent:: |
public | function | Returns a string describing why a JWT was considered invalid. | |
JwtAuthValidateEvent:: |
public | function | Returns whether a token was considered valid. |