private function getRedirectUrl(array $queryParams) {
        $baseUrl = $this->getReturnBaseUrl();

        if (!empty($baseUrl)) {
            return $baseUrl . (parse_url($baseUrl, PHP_URL_QUERY) ? '&' : '?') . http_build_query($queryParams);
        } else {
            throw new LtiException('Invalid LTI return url.');
        }
    }