protected function fetchAccessToken($queryData, $retry = true)
    {
        if (!$this->hasRequestToken()) {
            $this->consumer->setCallbackUrl($this->getCurrentUri());
            $this->fetchRequestToken();
            $this->consumer->redirect(array('hint' => $this->getHint()));
        }
        try {
            $token = $this->consumer->getAccessToken(
                $queryData,
                $this->getRequestToken()
            );
        } catch (InvalidArgumentException $e) {
            if ($retry) {
                // We might have a corrupt/invalid request token. Delete it and
                // retry once.
                $this->storage->delete(static::BIB_REQUEST_TOKEN);
                $this->storage->delete(static::BIB_ACCESS_TOKEN);
                return $this->fetchAccessToken($queryData, false);
            }
            throw $e;
        }
        // We got a new access token, we can remove the request token now.
        $this->storage->delete(static::BIB_REQUEST_TOKEN);
        $this->storage->set(static::BIB_ACCESS_TOKEN, $token);

        return $this;
    }