public class BasicAuthentication extends HTTPAuthentication
This method has a Keystone authentication method as fallback.
Example:
HTTPAuthentication auth = new BasicAuthentication("username", "password");
auth.setCAPath("/etc/grid-security/certificates/"); //path to CA directory
Client client = new HTTPClient(URI.create("https://remote.server.net"), auth);| Modifier and Type | Field and Description |
|---|---|
static String |
IDENTIFIER |
| Constructor and Description |
|---|
BasicAuthentication(String username,
String password) |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate()
Runs the authentication.
|
Authentication |
getFallback()
Returns authentication's fallback authentication method.
|
String |
getIdentifier()
Returns unique identifier for this authentication method.
|
String |
getPassword()
Returns password.
|
String |
getUsername()
Returns username.
|
protected void |
setAuthScheme(String authScheme) |
void |
setPassword(String password)
Sets password
|
void |
setUsername(String username)
Sets username.
|
createSSLContext, getCAFile, getCAPath, getConnection, getCredentialsProvider, getTarget, loadCAs, setCAFile, setCAPath, setConnection, setCredentialsProvider, setTargetpublic static final String IDENTIFIER
protected void setAuthScheme(String authScheme)
public String getUsername()
public void setUsername(String username)
username - usernamepublic String getPassword()
public void setPassword(String password)
password - passwordpublic String getIdentifier()
AuthenticationgetIdentifier in interface AuthenticationgetIdentifier in class HTTPAuthenticationpublic Authentication getFallback()
AuthenticationgetFallback in interface AuthenticationgetFallback in class HTTPAuthenticationpublic void authenticate()
throws CommunicationException
Authenticationauthenticate in interface Authenticationauthenticate in class HTTPAuthenticationCommunicationException - when error occures during the
communicationCopyright © 2016. All rights reserved.