private void addAuthHeaders(final BasicHttpRequest request) {
        Objects.requireNonNull(request);
        final String apiKey = config.getApiKey();
        if (NullSafe.isNonBlankString(apiKey)) {
            request.addHeader("Authorization", "Bearer " + apiKey.trim());
        }

        // Allows sending to systems on the same OpenId realm as us using an access token
        if (config.isAddOpenIdAccessToken()) {
            LOGGER.debug(() -> LogUtil.message(
                    "'{}' - Setting request props (values truncated):\n{}",
                    forwarderName,
                    userIdentityFactory.getServiceUserAuthHeaders()
                            .entrySet()
                            .stream()
                            .sorted(Entry.comparingByKey())
                            .map(entry ->
                                    "  " + String.join(":",
                                            entry.getKey(),
                                            LogUtil.truncateUnless(
                                                    entry.getValue(),
                                                    50,
                                                    LOGGER.isTraceEnabled())))
                            .collect(Collectors.joining("\n"))));

            userIdentityFactory.getServiceUserAuthHeaders()
                    .forEach(request::addHeader);
        }
    }
Handler class that forwards the request to a URL.
stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/HttpSender.java