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.");
    }
  }
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.");
    }
  }
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." ) ; } }
Validates that the Islandora data is present in the JWT.

@param \Drupal\jwt\Authentication\Event\JwtAuthValidateEvent $event
A JwtAuth event.
Validates that the Islandora data is present in the JWT .