You are here

class JwtAuthGenerateEvent in JSON Web Token Authentication (JWT) 8.0

Same name and namespace in other branches
  1. 8 src/Authentication/Event/JwtAuthGenerateEvent.php \Drupal\jwt\Authentication\Event\JwtAuthGenerateEvent

Class JwtAuthGenerateEvent.

@package Drupal\jwt\Authentication\Event

Hierarchy

Expanded class hierarchy of JwtAuthGenerateEvent

2 files declare their use of JwtAuthGenerateEvent
JwtAuth.php in src/Authentication/Provider/JwtAuth.php
JwtAuthIssuerSubscriber.php in modules/jwt_auth_issuer/src/EventSubscriber/JwtAuthIssuerSubscriber.php

File

src/Authentication/Event/JwtAuthGenerateEvent.php, line 10

Namespace

Drupal\jwt\Authentication\Event
View source
class JwtAuthGenerateEvent extends JwtAuthBaseEvent {

  /**
   * Adds a claim to a JsonWebToken.
   *
   * @see \Drupal\jwt\JsonWebToken\JsonWebTokenInterface::setClaim()
   */
  public function addClaim($claim, $value) {
    $this->jwt
      ->setClaim($claim, $value);
  }

  /**
   * Removes a claim from a JsonWebToken.
   *
   * @see \Drupal\jwt\JsonWebToken\JsonWebTokenInterface::unsetClaim()
   */
  public function removeClaim($claim) {
    $this->jwt
      ->unsetClaim($claim);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
JwtAuthBaseEvent::$jwt protected property The JsonWebToken.
JwtAuthBaseEvent::getToken public function Returns the JWT.
JwtAuthBaseEvent::__construct public function Constructs a JwtAuthEvent with a JsonWebToken. 1
JwtAuthGenerateEvent::addClaim public function Adds a claim to a JsonWebToken.
JwtAuthGenerateEvent::removeClaim public function Removes a claim from a JsonWebToken.