Hi Sergey,

> -----Original Message-----
> From: Sergey Beryozkin [mailto:[email protected]]
> Sent: Dienstag, 18. Dezember 2012 11:51
> To: [email protected]
> Subject: Re: Configure retry limit for failed authentication in REST Client
> 
> Hi Jan
> 
> On 18/12/12 10:28, Jan Bernhardt wrote:
> > It might be helpful to mention, that I use BASIC-Authentication here.
> 
> It is interesting.
> How do you enable basic auth on the client ? In HttpConduit or directly with
> JAXRSClientFactoryBean ?

I use setUsername(...) and setPassword(...) within JAXRSClientFactoryBean. I do 
not configure HttpConduit manually in any way.

> 
> I can see HttpConduit doing processRetransmit() calls every time it gets
> 401 (I'm not sure why yet - may be to handle different realm combintations),
> however it checks if the loop can be detected or not, and apparently, in your
> case, no loop can be detected for up to 41 times :-)
> 
> Can you please enable the client side logging so that we can see what is
> returned from the server with every 401 ? You can add the logging feature or
> LoggingInInterceptor,

I added logging feature to my setup, but for some reasons I currently can't 
figure out, I don't see any log messages on my console. But here is a sample 
message copied from my tcp-monitor (they look all the same):

    Status Code: 401 Unauthorized
    Content-Length: 1033
    Content-Type: text/html;charset=utf-8
    Date: Tue, 18 Dec 2012 14:15:09 GMT
    Server: Apache-Coyote/1.1
    WWW-Authenticate: Basic realm="Spring Security Application"

The HTTP Body contains an error message HTML encoded.

Best regards.
Jan

> 
> Cheers, Sergey
> 
> >
> > Regards.
> > Jan
> >
> >
> >> -----Original Message-----
> >> From: Jan Bernhardt [mailto:[email protected]]
> >> Sent: Dienstag, 18. Dezember 2012 11:26
> >> To: [email protected]
> >> Subject: Configure retry limit for failed authentication in REST
> >> Client
> >>
> >> Hi CXF Users,
> >>
> >> is it possible to configure a maximum limit of automatic retries for
> >> a CXF REST Client?
> >>
> >> I use JAXRSClientFactoryBean to create my service proxy. And when I
> >> test a method with wrong credentials, I get 41 retries on my TCP
> >> Monitor. So many false tries causes my account to be suspended...
> >>
> >> I think it would be best, if CXF only tries once by default and
> >> throws an exception directly if authentication fails. Automatic
> >> retries could be helpful in some cases but IMHO I don't think this should
> be default behavior.
> >>
> >> WDYT?
> >>
> >> Best regards
> >> Jan

Reply via email to