Arjohn Kampman-2 wrote
> We've updated from restlet 2.1.4 to 2.2.0 now and to our surprise this 
> fixed the Redirector problems. In fact, Redirector works perfectly 
> out-of-the-box, including the digest authentication. No subclassing 
> required. So probably this was a bug in 2.1.4 that has been fixed 
> somewhere in the 2.2 development.

Thanks for this info, which gives me some confidence that I can get this
working too with some help. In order to set the authentication information
for a MODE_SERVER_OUTBOUND redirection, I added a filter (code shown below),
in front of the Redirector, to set the ChallengeResponse as shown below. But
I could never get this authentication work successfully, since the server
always fails authentication for the passed username/password. I would
appreciate if you could share the details on how you passed the
authentication details to the Redirector.

public class MyRedirectorAuthenticatorFilter extends Filter {

       public MyRedirectorAuthenticatorFilter(Context context) {
                this.setContext(context);

        }

        @Override
        protected int doHandle(Request request, Response response) {

                String username = "username";
                String password = "plaintext password";

                request.setProxyChallengeResponse(new ChallengeResponse(
                                ChallengeScheme.HTTP_DIGEST, username, 
password));

                return super.doHandle(request, response);

        }
}

And in my application, I have,

                String target2 = "http://localhost:8080/MyWebApp{rr}";;
                Redirector redirector2 = new Redirector(getContext(), target2,
                                Redirector.MODE_SERVER_OUTBOUND);
                MyRedirectorAuthenticatorFilter myfilter = new
MyRedirectorAuthenticatorFilter(getContext());
                myfilter.setNext(redirector2);
                router.attach("/myapp", myfilter);

Appreciate your help on this.





--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Transparent-reverse-proxying-using-org-restlet-routing-Redirector-tp7579113p7579179.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3078323

Reply via email to