public class DefaultCredentialsProvider extends Object implements 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() |
Credentials |
getCredentials(AuthScope authscope) |
boolean |
removeCredentials(AuthScope authscope)
Removes the credentials from the AuthScope.
|
void |
setCredentials(AuthScope authscope,
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(AuthScope authscope, Credentials credentials)
setCredentials in interface CredentialsProviderpublic Credentials getCredentials(AuthScope authscope)
getCredentials in interface CredentialsProviderpublic boolean removeCredentials(AuthScope authscope)
authscope - the AuthScope to remove the credentials ofpublic void clear()
clear in interface CredentialsProviderCopyright © 2002–2019 Gargoyle Software Inc.. All rights reserved.