|
||||||||||
| 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 Digest authentication, and Basic HTTP authentication. See NTLM authentication to use NTLM from HtlmUnit.
| 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 |
clear()
|
org.apache.http.auth.Credentials |
getCredentials(org.apache.http.auth.AuthScope authscope)
|
void |
setCredentials(org.apache.http.auth.AuthScope authscope,
org.apache.http.auth.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 credentials
public 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)
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
public void setCredentials(org.apache.http.auth.AuthScope authscope,
org.apache.http.auth.Credentials credentials)
setCredentials in interface org.apache.http.client.CredentialsProviderpublic org.apache.http.auth.Credentials getCredentials(org.apache.http.auth.AuthScope authscope)
getCredentials in interface org.apache.http.client.CredentialsProviderpublic String toString()
toString in class Objectpublic void clear()
clear in interface org.apache.http.client.CredentialsProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||