@Override
        public boolean isRedirected(HttpRequest request, HttpResponse response,
                                    HttpContext context)
                throws ProtocolException {
            boolean isRedirectedSuper = super.isRedirected(request, response, context);
            if (isRedirectedSuper) {
                Header locationHeader = response.getFirstHeader("Location");
                String location = locationHeader.getValue();
                if (StringUtils.isBlank(location)) {
                    return false;
                }
                URI uri;
                try {
                    uri = new URI(location);
                } catch (URISyntaxException e) {
                    return true;
                }
                if (!allowedHosts.isEmpty() && !allowedHosts.contains(uri.getHost())) {
                    LOG.info("Not allowing external redirect. OriginalUrl={}," +
                            " RedirectLocation={}", request.getRequestLine().getUri(), location);
                    return false;
                }
            }
            return isRedirectedSuper;
        }
only basic and ntlm are supported

@param authScheme
tika-pipes/tika-httpclient-commons/src/main/java/org/apache/tika/client/HttpClientFactory.java