public abstract class AuthenticationImpl extends Object implements Authentication, org.objectweb.proactive.RunActive
Modifier and Type | Field and Description |
---|---|
protected String |
privateKeyPath
Path to the private key file for used for authentication
|
protected String |
publicKeyPath
Path to the private key file for used for authentication
|
Constructor and Description |
---|
AuthenticationImpl()
Empty constructor
|
AuthenticationImpl(String jaasPath,
String privPath,
String pubPath)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
Subject |
authenticate(Credentials cred)
Performs login.
|
protected abstract String |
getLoginMethod()
Defines login method
|
byte[] |
getPrivateKey()
Request this Authentication's private key for credentials encryption
|
PublicKey |
getPublicKey()
Request this AuthenticationImpl's public key.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
isActivated()
Checks whether an authentication is activated or in other words is ready to authenticate users.
|
void |
runActivity(org.objectweb.proactive.Body body)
Method controls the execution of every request.
|
void |
setActivated(boolean activated)
Activates or desactivates authentication active object
|
boolean |
terminate()
Terminates the active object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHostURL, getJMXConnectorURL, getJMXConnectorURL
protected String privateKeyPath
protected String publicKeyPath
public AuthenticationImpl()
public AuthenticationImpl(String jaasPath, String privPath, String pubPath)
Loads jaas.config and stores it in global system property, also locates keypair used for authentication: public key is used to encrypt credentials to make the old deprecated API still compatible, private key is used to decrypt credentials in the new API.
jaasPath
- path to the jaas configuration fileprivPath
- path to the private key filepubPath
- path to the public key fileprotected abstract String getLoginMethod()
public Subject authenticate(Credentials cred) throws LoginException
authenticate
in interface Authentication
cred
- encrypted username and passwordLoginException
- if username or password is incorrect.public PublicKey getPublicKey() throws LoginException
The public key provided by this method can be used to create encrypted credentials with
Credentials.createCredentials(String, String, PublicKey)
.
The private key corresponding to this public key will be used for decryption.
getPublicKey
in interface Authentication
LoginException
- the key could not be retrievedpublic byte[] getPrivateKey() throws LoginException
Authentication
getPrivateKey
in interface Authentication
LoginException
- the key could not be retrievedpublic org.objectweb.proactive.core.util.wrapper.BooleanWrapper isActivated()
Authentication
isActivated
in interface Authentication
Authentication.isActivated()
public void setActivated(boolean activated)
activated
- the status of the desired activated state.public boolean terminate()
public void runActivity(org.objectweb.proactive.Body body)
runActivity
in interface org.objectweb.proactive.RunActive