You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by RB W <to...@hotmail.com> on 2005/12/10 19:13:25 UTC

Help with CredentialsProvider for Axis

I am using the commons http client with Axis. I wrote my own 
CredentialsProvider to provide credentials for the Axis client by 
interactively requesting them from the user. This works fine, but has a 
significant problem. When asked a second time for credentials, my provider 
does not know whether the previous credentials worked or not, and therefore 
does not know whether to prompt the user for new credentials, or return the 
previous ones. Because I don't control the HttpClient, I don't know if the 
previous credentials worked or not.

Is there any way of knowing if my previously provided credentials were valid 
or not? Can I implement some kind of factory so that I have access to the 
objects I need to know what is happening?

Thanks in advance.

Robert Wille

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


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


Re: Help with CredentialsProvider for Axis

Posted by Michael Becke <mb...@gmail.com>.
If that's the case you will need to either change Axis or implement
caching inside of the provider.

Mike

On 12/12/05, RB W <to...@hotmail.com> wrote:
> My credentials provider gets called on every request. I looked at the Axis
> code, and it creates a new HttpClient object for each request. I assume that
> is the reason why the credentials cache is not being used.
>
> Any other ideas?
>
> >It's up to the CredentialsProvider to handle multiple requests for the
> >same credentials.  You  will know that authentication has failed if
> >HttpClient asks for credentials for the same scheme/host/port more
> >than once.  By default HttpClient caches credentials in the associated
> >HttpState object (if authentication is successful) and will
> >automatically reuse them for future requests.
> >
> >Mike
> >
> >On 12/10/05, RB W <to...@hotmail.com> wrote:
> > > I am using the commons http client with Axis. I wrote my own
> > > CredentialsProvider to provide credentials for the Axis client by
> > > interactively requesting them from the user. This works fine, but has a
> > > significant problem. When asked a second time for credentials, my
> >provider
> > > does not know whether the previous credentials worked or not, and
> >therefore
> > > does not know whether to prompt the user for new credentials, or return
> >the
> > > previous ones. Because I don't control the HttpClient, I don't know if
> >the
> > > previous credentials worked or not.
> > >
> > > Is there any way of knowing if my previously provided credentials were
> >valid
> > > or not? Can I implement some kind of factory so that I have access to
> >the
> > > objects I need to know what is happening?
> > >
> > > Thanks in advance.
> > >
> > > Robert Wille
> > >
> > > _________________________________________________________________
> > > FREE pop-up blocking with the new MSN Toolbar – get it now!
> > > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> > >
> > >
>
> _________________________________________________________________
> FREE pop-up blocking with the new MSN Toolbar – get it now!
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>

Re: Help with CredentialsProvider for Axis

Posted by RB W <to...@hotmail.com>.
My credentials provider gets called on every request. I looked at the Axis 
code, and it creates a new HttpClient object for each request. I assume that 
is the reason why the credentials cache is not being used.

Any other ideas?

>It's up to the CredentialsProvider to handle multiple requests for the
>same credentials.  You  will know that authentication has failed if
>HttpClient asks for credentials for the same scheme/host/port more
>than once.  By default HttpClient caches credentials in the associated
>HttpState object (if authentication is successful) and will
>automatically reuse them for future requests.
>
>Mike
>
>On 12/10/05, RB W <to...@hotmail.com> wrote:
> > I am using the commons http client with Axis. I wrote my own
> > CredentialsProvider to provide credentials for the Axis client by
> > interactively requesting them from the user. This works fine, but has a
> > significant problem. When asked a second time for credentials, my 
>provider
> > does not know whether the previous credentials worked or not, and 
>therefore
> > does not know whether to prompt the user for new credentials, or return 
>the
> > previous ones. Because I don't control the HttpClient, I don't know if 
>the
> > previous credentials worked or not.
> >
> > Is there any way of knowing if my previously provided credentials were 
>valid
> > or not? Can I implement some kind of factory so that I have access to 
>the
> > objects I need to know what is happening?
> >
> > Thanks in advance.
> >
> > Robert Wille
> >
> > _________________________________________________________________
> > FREE pop-up blocking with the new MSN Toolbar – get it now!
> > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> >
> >

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


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


Re: Help with CredentialsProvider for Axis

Posted by Michael Becke <mb...@gmail.com>.
Hi Robert,

It's up to the CredentialsProvider to handle multiple requests for the
same credentials.  You  will know that authentication has failed if
HttpClient asks for credentials for the same scheme/host/port more
than once.  By default HttpClient caches credentials in the associated
HttpState object (if authentication is successful) and will
automatically reuse them for future requests.

Mike

On 12/10/05, RB W <to...@hotmail.com> wrote:
> I am using the commons http client with Axis. I wrote my own
> CredentialsProvider to provide credentials for the Axis client by
> interactively requesting them from the user. This works fine, but has a
> significant problem. When asked a second time for credentials, my provider
> does not know whether the previous credentials worked or not, and therefore
> does not know whether to prompt the user for new credentials, or return the
> previous ones. Because I don't control the HttpClient, I don't know if the
> previous credentials worked or not.
>
> Is there any way of knowing if my previously provided credentials were valid
> or not? Can I implement some kind of factory so that I have access to the
> objects I need to know what is happening?
>
> Thanks in advance.
>
> Robert Wille
>
> _________________________________________________________________
> FREE pop-up blocking with the new MSN Toolbar – get it now!
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>