|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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.
Constructor Summary | |
---|---|
DefaultCredentialsProvider()
|
Method Summary | |
---|---|
void |
addCredentials(String username,
String password)
Adds credentials for the specified username/password for any host/port/realm combination. |
void |
addCredentials(String username,
String password,
String host,
int port,
String realm)
Adds credentials for the specified username/password on the specified host/port for the specified realm. |
void |
addNTLMCredentials(String username,
String password,
String host,
int port,
String workstation,
String domain)
Adds NTLM credentials for the specified username/password on the specified host/port. |
void |
addNTLMProxyCredentials(String username,
String password,
String host,
int port,
String workstation,
String domain)
Deprecated. as of 2.8, please use addNTLMCredentials(String, String, String, int, String, String) instead |
void |
addProxyCredentials(String username,
String password)
Deprecated. as of 2.8, please use addCredentials(String, String) instead |
void |
addProxyCredentials(String username,
String password,
String host,
int port)
Deprecated. as of 2.8, please use addCredentials(String, String, String, int, String) instead |
void |
clear()
|
Credentials |
getCredentials(AuthScope authscope)
|
void |
setCredentials(AuthScope authscope,
Credentials credentials)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultCredentialsProvider()
Method Detail |
---|
public void addCredentials(String username, String password)
username
- the username for the new credentialspassword
- the password for the new credentialspublic void addCredentials(String username, String password, String host, int port, String realm)
username
- the username for the new credentialspassword
- the password for the new credentialshost
- 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)@Deprecated public void addProxyCredentials(String username, String password)
addCredentials(String, String)
instead
username
- the username for the new credentialspassword
- the password for the new credentials@Deprecated public void addProxyCredentials(String username, String password, String host, int port)
addCredentials(String, String, String, int, String)
instead
username
- the username for the new credentialspassword
- the password for the new credentialshost
- 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 void addNTLMCredentials(String username, String password, String host, int port, String workstation, String domain)
username
- the username for the new credentials; should not include the domain to authenticate with;
for example: "user" is correct whereas "DOMAIN\\user" is notpassword
- the password for the new credentialshost
- 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)workstation
- The workstation the authentication request is originating from.
Essentially, the computer name for this machine.domain
- the domain to authenticate within@Deprecated public void addNTLMProxyCredentials(String username, String password, String host, int port, String workstation, String domain)
addNTLMCredentials(String, String, String, int, String, String)
instead
username
- the username for the new credentials; should not include the domain to authenticate with;
for example: "user" is correct whereas "DOMAIN\\user" is not.password
- the password for the new credentialshost
- 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)workstation
- the host the authentication request is originating from; essentially, the computer name for
this machinedomain
- the domain to authenticate withinpublic void setCredentials(AuthScope authscope, Credentials credentials)
setCredentials
in interface CredentialsProvider
public Credentials getCredentials(AuthScope authscope)
getCredentials
in interface CredentialsProvider
public String toString()
toString
in class Object
public void clear()
clear
in interface CredentialsProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |