public function validate(JwtAuthValidateEvent $event) {
    $token = $event->getToken();

    $uid = $token->getClaim('webid');
    $name = $token->getClaim('sub');
    $roles = $token->getClaim('roles');
    $url = $token->getClaim('iss');
    if ($uid === NULL || $name === NULL || $roles === NULL || $url === NULL) {
      $event->invalidate("Expected data missing from payload.");
      return;
    }

    $user = $this->userStorage->load($uid);
    if ($user === NULL) {
      $event->invalidate("Specified UID does not exist.");
    }
    elseif ($user->getAccountName() !== $name) {
      $event->invalidate("Account name does not match.");
    }
  }