public class DefaultCredentialsProvider extends Object implements org.apache.http.client.CredentialsProvider, Serializable
Constructor and Description |
---|
DefaultCredentialsProvider() |
Modifier and Type | Method and Description |
---|---|
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() |
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)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 withinpublic void setCredentials(org.apache.http.auth.AuthScope authscope, org.apache.http.auth.Credentials credentials)
setCredentials
in interface org.apache.http.client.CredentialsProvider
public org.apache.http.auth.Credentials getCredentials(org.apache.http.auth.AuthScope authscope)
getCredentials
in interface org.apache.http.client.CredentialsProvider
public void clear()
clear
in interface org.apache.http.client.CredentialsProvider
Copyright © 2002–2015 Gargoyle Software Inc.. All rights reserved.