I don't have time to look at this, unfortunately. I have Basic auth working with outbound redirection. I *don't *change the way the headers are removed, but I do remove the challenge response.
// From my Redirector subclass: @Override protected void outboundServerRedirect( Reference targetRef, Request request, Response response) { // Unset challenge response that authentication puts in. request.setChallengeResponse(null); super.outboundServerRedirect(targetRef, request, response); } Before I did this, I believe I had internal connector errors similar to what you describe. --tim On Fri, Apr 18, 2014 at 4:14 AM, Primož Kokol <primoz.ko...@gmail.com>wrote: > Hi again, > > My next try was to remove all original headers (like default > implementation do) and then preserver only Authentication header. > > So I replaced this line: > > > https://github.com/restlet/restlet-framework-java/blob/2.2/modules/org.restlet/src/org/restlet/routing/Redirector.java#L407 > > with call to this method: > > private void preserveHeaders(Request request) > { > Series<Header> headers = (Series<Header>) > request.getAttributes().get(HeaderConstants.ATTRIBUTE_HEADERS); > Series<Header> newHeaders = new > Series<Header>(Header.class); > > for (String headerName : headersToPreserve) { > Header headerToPreserve = > headers.getFirst(headerName); > if (headerToPreserve != null) { > newHeaders.add(headerToPreserve); > } > } > > request.getAttributes().put(HeaderConstants.ATTRIBUTE_HEADERS, newHeaders); > } > > where > > headersToPreserve = > Arrays.asList(HeaderConstants.HEADER_AUTHORIZATION) > > After this change, the response from proxy is always: > > HTTP/1.1 1002 Internal Connector Error > Date: Fri, 18 Apr 2014 08:01:10 GMT > Accept-Ranges: bytes > Server: Restlet-Framework/2.1.4 > Content-Length: 484 > Content-Type: text/html; charset=UTF-8 > > I am somehow abandoning the idea of using Restlet as a transparent reverse > proxy, but anyway, I've attached a small example of test implementation if > someone will have time and willpower to look at it. > > Tim, thank you for your support! > > Any advices on how could I achieve Digest/Basic authentication to work on > backend server when in front of it is a proxy are still welcome. > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3076691 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3076698