Interface CredentialsProvider

public interface CredentialsProvider

Credentials provider interface can be used to provide HTTP method with a means to request authentication credentials if no credentials have been given or given credentials are incorrect.

HttpClient makes no provisions to check whether the same credentials have been tried already. It is a responsibility of the custom credentials provider to keep track of authentication attempts and to ensure that credentials known to be invalid are not retried. HttpClient will simply store the set of credentials returned by the custom credentials provider in the http state object and will attempt to use these credentials for all subsequent requests with the given authentication scope.

Classes implementing this interface must synchronize access to shared data as methods of this interfrace may be executed from multiple threads

Ortwin Glueck, Oleg Kalnichevski

Field Summary
static String PROVIDER
          Sets the credentials provider parameter.
Method Summary
 Credentials getCredentials(AuthScheme scheme, String host, int port, boolean proxy)
          Requests additional authentication credentials.

Field Detail


static final String PROVIDER
Sets the credentials provider parameter.

This parameter expects a value of type CredentialsProvider.

See Also:
Constant Field Values
Method Detail


Credentials getCredentials(AuthScheme scheme,
                           String host,
                           int port,
                           boolean proxy)
                           throws CredentialsNotAvailableException
Requests additional authentication credentials.

scheme - the authentication scheme
host - the authentication host
port - the port of the authentication host
proxy - true if authenticating with a proxy, false otherwise

Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.