You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by mclovis <mc...@mindbridge.com> on 2004/03/19 15:01:15 UTC

Repost: Authentication question

In 2.0 release is there a way to find (query) the server to get the
authentication scheme in order to know what Credentials to use? I an new
at this and would appreciate any help. Thanks in advance.


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


Re: Repost: Authentication question

Posted by Roland Weber <RO...@de.ibm.com>.
Hello,

use HttpMethod.setDoAuthentication(false). Then,
your application will get the 40x response directly
and can check the returned headers for the auth
scheme and parameters.
If it's basic auth, you should enable preemptive
authentication after providing the credentials, to
avoid unnecessary round trips.

If you are using the development version of HttpClient,
it's even simpler. Implement the interface
...auth.CredentialsProvider and all the information you
require will be passed in as method arguments to
getCredentials()

cheers,
  Roland






mclovis <mc...@mindbridge.com>
19.03.2004 15:01
Please respond to "Commons HttpClient Project"
 
        To:     Jakarta Commons HttpClient mailing list 
<co...@jakarta.apache.org>
        cc: 
        Subject:        Repost: Authentication question


In 2.0 release is there a way to find (query) the server to get the
authentication scheme in order to know what Credentials to use? I an new
at this and would appreciate any help. Thanks in advance.


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