|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.DefaultCredentialsProvider
public class DefaultCredentialsProvider
Default HtmlUnit implementation of the CredentialsProvider interface. Provides credentials for both web servers and proxies. Supports NTLM authentication, Digest authentication, and Basic HTTP authentication.
Field Summary |
---|
Fields inherited from interface org.apache.commons.httpclient.auth.CredentialsProvider |
---|
PROVIDER |
Constructor Summary | |
---|---|
DefaultCredentialsProvider()
Creates a new DefaultCredentialsProvider instance. |
Method Summary | |
---|---|
void |
addCredentials(java.lang.String username,
java.lang.String password)
Adds credentials for the specified username/password for any host/port/realm combination. |
void |
addCredentials(java.lang.String username,
java.lang.String password,
java.lang.String host,
int port,
java.lang.String realm)
Adds credentials for the specified username/password on the specified host/port for the specified realm. |
void |
addNTLMCredentials(java.lang.String username,
java.lang.String password,
java.lang.String host,
int port,
java.lang.String clientHost,
java.lang.String clientDomain)
Adds NTLM credentials for the specified username/password on the specified host/port. |
void |
addNTLMProxyCredentials(java.lang.String username,
java.lang.String password,
java.lang.String host,
int port,
java.lang.String clientHost,
java.lang.String clientDomain)
Adds NTLM proxy credentials for the specified username/password on the specified host/port. |
void |
addProxyCredentials(java.lang.String username,
java.lang.String password)
Adds proxy credentials for the specified username/password for any host/port/realm combination. |
void |
addProxyCredentials(java.lang.String username,
java.lang.String password,
java.lang.String host,
int port)
Adds proxy credentials for the specified username/password on the specified host/port. |
org.apache.commons.httpclient.Credentials |
getCredentials(org.apache.commons.httpclient.auth.AuthScheme scheme,
java.lang.String host,
int port,
boolean proxy)
Returns the credentials associated with the specified scheme, host and port |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultCredentialsProvider()
Method Detail |
---|
public void addCredentials(java.lang.String username, java.lang.String password)
username
- The username for the new credentials.password
- The password for the new credentials.public void addCredentials(java.lang.String username, java.lang.String password, java.lang.String host, int port, java.lang.String realm)
username
- The username for the new credentials.password
- The password for the new credentials.host
- The host to which to the new credentials apply (null if applicable to any host).port
- The port to which to the new credentials apply (negative if applicable to any port).realm
- The realm to which to the new credentials apply (null if applicable to any realm).public void addNTLMCredentials(java.lang.String username, java.lang.String password, java.lang.String host, int port, java.lang.String clientHost, java.lang.String clientDomain)
username
- The username for the new credentials. This should not include the domain to authenticate with.
For example: "user" is correct whereas "DOMAIN\\user" is not.password
- The password for the new credentials.host
- The host to which to the new credentials apply (null if applicable to any host).port
- The port to which to the new credentials apply (negative if applicable to any port).clientHost
- The host the authentication request is originating from. Essentially, the computer name for
this machine.clientDomain
- The domain to authenticate within.public void addNTLMProxyCredentials(java.lang.String username, java.lang.String password, java.lang.String host, int port, java.lang.String clientHost, java.lang.String clientDomain)
username
- The username for the new credentials. This should not include the domain to authenticate with.
For example: "user" is correct whereas "DOMAIN\\user" is not.password
- The password for the new credentials.host
- The host to which to the new credentials apply (null if applicable to any host).port
- The port to which to the new credentials apply (negative if applicable to any port).clientHost
- The host the authentication request is originating from. Essentially, the computer name for
this machine.clientDomain
- The domain to authenticate within.public void addProxyCredentials(java.lang.String username, java.lang.String password)
username
- The username for the new credentials.password
- The password for the new credentials.public void addProxyCredentials(java.lang.String username, java.lang.String password, java.lang.String host, int port)
username
- The username for the new credentials.password
- The password for the new credentials.host
- The host to which to the new credentials apply (null if applicable to any host).port
- The port to which to the new credentials apply (negative if applicable to any port).public org.apache.commons.httpclient.Credentials getCredentials(org.apache.commons.httpclient.auth.AuthScheme scheme, java.lang.String host, int port, boolean proxy) throws org.apache.commons.httpclient.auth.CredentialsNotAvailableException
getCredentials
in interface org.apache.commons.httpclient.auth.CredentialsProvider
scheme
- The authentication scheme being used (basic, digest, NTLM, etc).host
- The host we are authenticating for.port
- The port we are authenticating for.proxy
- Whether or not we are authenticating using a proxy.
null
if already asked for it to avoid infinite loop
org.apache.commons.httpclient.auth.CredentialsNotAvailableException
- If the specified credentials cannot be provided due to an error.CredentialsProvider.getCredentials(AuthScheme, String, int, boolean)
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |