You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Daniel Florey <da...@web.de> on 2004/12/08 14:43:00 UTC

[httpclient] Authentication per connection?

Hi folks,
I currently try to migrate the project I'm working on from httpclient 2.0 to
httpclient3.0.
As the authentication stuff changed, I'm struggling how to set the
credentials per connection. Any hints?
I'm using the MultiThreadedHttpConnectionManager and figured out how to set
authentication on a per realm basis, but this in not what I need.
I need credentials for each user, as I'm in a multi user environment.
Everything worked fine with 2.0 as I could pass the HttpState to the method,
but this is not working with the multithreaded environment.
I guess that I've missed something, so any help is appreciated.
Thanks,
Daniel


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


AW: [httpclient] Authentication per connection?

Posted by Daniel Florey <da...@web.de>.
Uups, I overlooked that it's possible to pass the HttpState to the
executeMethod()...
Thanks for the hint!
Cheers,
Daniel

> -----Ursprüngliche Nachricht-----
> Von: commons-user-return-10002-daniel.florey=web.de@jakarta.apache.org
> [mailto:commons-user-return-10002-daniel.florey=web.de@jakarta.apache.org]
> Im Auftrag von Oleg Kalnichevski
> Gesendet: Mittwoch, 8. Dezember 2004 19:10
> An: Jakarta Commons Users List
> Betreff: Re: [httpclient] Authentication per connection?
> 
> Daniel,
> 
> How about this?
> 
> (1) Have one thread per user connection
> (2) Maintain a separate HttpState instance per thread
> (3) when executing an HTTP method in a thread, pass the HttpState
> instance as an additional parameter to HttpClient#executeMethod
> 
> Hope this helps
> 
> Oleg
> 
> 
> On Wed, 2004-12-08 at 14:43 +0100, Daniel Florey wrote:
> > Hi folks,
> > I currently try to migrate the project I'm working on from httpclient
> 2.0 to
> > httpclient3.0.
> > As the authentication stuff changed, I'm struggling how to set the
> > credentials per connection. Any hints?
> > I'm using the MultiThreadedHttpConnectionManager and figured out how to
> set
> > authentication on a per realm basis, but this in not what I need.
> > I need credentials for each user, as I'm in a multi user environment.
> > Everything worked fine with 2.0 as I could pass the HttpState to the
> method,
> > but this is not working with the multithreaded environment.
> > I guess that I've missed something, so any help is appreciated.
> > Thanks,
> > Daniel
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [httpclient] Authentication per connection?

Posted by Oleg Kalnichevski <ol...@apache.org>.
Daniel,

How about this?

(1) Have one thread per user connection
(2) Maintain a separate HttpState instance per thread
(3) when executing an HTTP method in a thread, pass the HttpState
instance as an additional parameter to HttpClient#executeMethod

Hope this helps

Oleg


On Wed, 2004-12-08 at 14:43 +0100, Daniel Florey wrote:
> Hi folks,
> I currently try to migrate the project I'm working on from httpclient 2.0 to
> httpclient3.0.
> As the authentication stuff changed, I'm struggling how to set the
> credentials per connection. Any hints?
> I'm using the MultiThreadedHttpConnectionManager and figured out how to set
> authentication on a per realm basis, but this in not what I need.
> I need credentials for each user, as I'm in a multi user environment.
> Everything worked fine with 2.0 as I could pass the HttpState to the method,
> but this is not working with the multithreaded environment.
> I guess that I've missed something, so any help is appreciated.
> Thanks,
> Daniel
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org