You are here

public function JwtAuthGenerateEvent::addClaim 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::addClaim()

Adds a claim to a JsonWebToken.

See also

\Drupal\jwt\JsonWebToken\JsonWebTokenInterface::setClaim()

File

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

Class

JwtAuthGenerateEvent
Class JwtAuthGenerateEvent.

Namespace

Drupal\jwt\Authentication\Event

Code

public function addClaim($claim, $value) {
  $this->jwt
    ->setClaim($claim, $value);
}