public function JwtAuthIssuerSubscriber::setDrupalClaims in JSON Web Token Authentication (JWT) 8
Same name and namespace in other branches
- 8.0 modules/jwt_auth_issuer/src/EventSubscriber/JwtAuthIssuerSubscriber.php \Drupal\jwt_auth_issuer\EventSubscriber\JwtAuthIssuerSubscriber::setDrupalClaims()
Sets claims for a Drupal consumer on the JWT.
Parameters
\Drupal\jwt\Authentication\Event\JwtAuthGenerateEvent $event: The event.
File
- modules/
jwt_auth_issuer/ src/ EventSubscriber/ JwtAuthIssuerSubscriber.php, line 61
Class
- JwtAuthIssuerSubscriber
- Class JwtAuthIssuerSubscriber.
Namespace
Drupal\jwt_auth_issuer\EventSubscriberCode
public function setDrupalClaims(JwtAuthGenerateEvent $event) {
$event
->addClaim([
'drupal',
'uid',
], $this->currentUser
->id());
}