public function isValid($headersOnly = false)
  {
    $accessToken = $this->determineAccessToken($headersOnly);

    $result = $this->storages['session']->validateAccessToken($accessToken);

    if ( ! $result) {
      throw new InvalidAccessTokenException('Access token is not valid');
    }

    $this->accessToken = $accessToken;
    $this->sessionId = $result['session_id'];
    $this->clientId = $result['client_id'];
    $this->ownerType = $result['owner_type'];
    $this->ownerId = $result['owner_id'];

    $sessionScopes = $this->storages['session']->getScopes($this->accessToken);
    foreach ($sessionScopes as $scope) {
      $this->sessionScopeIds[] = $scope['id'];
      $this->sessionScopes[]   = $scope['scope'];
    }

    return true;
  }