public function setIslandoraClaims(JwtAuthGenerateEvent $event) {
    global $base_secure_url;

    // Standard claims, validated at JWT validation time.
    $event->addClaim('iat', time());
    $expiry_setting = \Drupal::config(IslandoraSettingsForm::CONFIG_NAME)
      ->get(IslandoraSettingsForm::JWT_EXPIRY);
    $expiry = $expiry_setting ? $expiry_setting : '+2 hour';
    $event->addClaim('exp', strtotime($expiry));
    $event->addClaim('webid', $this->currentUser->id());
    $event->addClaim('iss', $base_secure_url);

    // Islandora claims we need to validate.
    $event->addClaim('sub', $this->currentUser->getAccountName());
    $event->addClaim('roles', $this->currentUser->getRoles(FALSE));

  }
public function setIslandoraClaims(JwtAuthGenerateEvent $event) {
    global $base_secure_url;

    // Standard claims, validated at JWT validation time.
    $event->addClaim('iat', time());
    $expiry_setting = \Drupal::config(IslandoraSettingsForm::CONFIG_NAME)
      ->get(IslandoraSettingsForm::JWT_EXPIRY);
    $expiry = $expiry_setting ? $expiry_setting : '+2 hour';
    $event->addClaim('exp', strtotime($expiry));
    $event->addClaim('webid', $this->currentUser->id());
    $event->addClaim('iss', $base_secure_url);

    // Islandora claims we need to validate.
    $event->addClaim('sub', $this->currentUser->getAccountName());
    $event->addClaim('roles', $this->currentUser->getRoles(FALSE));

  }
public function setIslandoraClaims ( JwtAuthGenerateEvent $ event ) { global $ base_secure_url ; // Standard claims, validated at JWT validation time. $ event -> addClaim ( 'iat' , time ( ) ) ; $ expiry_setting = \ Drupal :: config ( IslandoraSettingsForm :: CONFIG_NAME ) -> get ( IslandoraSettingsForm :: JWT_EXPIRY ) ; $ expiry = $ expiry_setting ? $ expiry_setting : '+2 hour' ; $ event -> addClaim ( 'exp' , strtotime ( $ expiry ) ) ; $ event -> addClaim ( 'webid' , $ this -> currentUser -> id ( ) ) ; $ event -> addClaim ( 'iss' , $ base_secure_url ) ; // Islandora claims we need to validate. $ event -> addClaim ( 'sub' , $ this -> currentUser -> getAccountName ( ) ) ; $ event -> addClaim ( 'roles' , $ this -> currentUser -> getRoles ( FALSE ) ) ; }
Sets claims for a Islandora consumer on the JWT.

@param \Drupal\jwt\Authentication\Event\JwtAuthGenerateEvent $event
The event.
Sets claims for a Islandora consumer on the JWT .