hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Tanner <mockingcom...@yahoo.com>
Subject HttpClient and Web App Credentials
Date Tue, 14 Oct 2008 17:50:36 GMT

I'm torn!  I'm using HttpClient in a Web application which uses the
authentication information from the Web app login to set credentials in the
HttpClient.  I see that getState() is synchronized, but if I’m only using
one instance of the HttpClient in my web app, I could potentially send a
request to the back-end web server using credentials from a different user
I have a choice to make, I’m not sure which is best:
    o  I could create a synchronized block on the HttpClient instance that I
fetch from my singleton class and set the credentials and execute the
request in the same block.

    o  I can setup the HttpClient with the credentials using
.getState().setCredentials and then store the client in the session of the
web app.  Problem is HttpClient does not implement serializable and my
environment is clustered.

    o  I can create a new instance of HttpClient for every call to the
backend web server – blah!


View this message in context: http://www.nabble.com/HttpClient-and-Web-App-Credentials-tp19978744p19978744.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message