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, setTarget
public 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()
Authentication
getIdentifier
in interface Authentication
getIdentifier
in class HTTPAuthentication
public Authentication getFallback()
Authentication
getFallback
in interface Authentication
getFallback
in class HTTPAuthentication
public void authenticate() throws CommunicationException
Authentication
authenticate
in interface Authentication
authenticate
in class HTTPAuthentication
CommunicationException
- when error occures during the
communicationCopyright © 2016. All Rights Reserved.