|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.silverpeas.authentication.Authentication
public abstract class Authentication
A set of security-related operations about a user authentication. The authentication is performed by a server of a remote authentication service and an instance of this class manages for Silverpeas the negotiation with the service to perform the asked security-related operation. Each concrete implementation of this abstract class must implement the communication protocol with the a server of the remote service; it is dedicated to a given authentication service.
| Field Summary | |
|---|---|
protected boolean |
enabled
|
static String |
ENC_TYPE_CLEAR
|
static String |
ENC_TYPE_MD5
|
static String |
ENC_TYPE_UNIX
|
protected static String |
module
|
static String |
PASSWORD_CHANGE_ALLOWED
|
static String |
PASSWORD_IS_ABOUT_TO_EXPIRE
|
| Constructor Summary | |
|---|---|
Authentication()
|
|
| Method Summary | ||
|---|---|---|
void |
authenticate(AuthenticationCredential credential)
Authenticates the user with its specified credential (containing a password in clear). |
|
void |
changePassword(AuthenticationCredential credential,
String newPassword)
Changes the password of the user, authenticated with the specified credential, with the specified new one. |
|
protected abstract
|
closeConnection(AuthenticationConnection<T> connection)
Closes the connection that was previously opened with the server of the remote authentication service. |
|
protected abstract
|
doAuthentication(AuthenticationConnection<T> connection,
AuthenticationCredential credential)
Does the authentication by using the specified connection with the remote server and with with the specified user credential. |
|
protected
|
doChangePassword(AuthenticationConnection<T> connection,
AuthenticationCredential credential,
String newPassword)
Does the password change by using the specified connection with the remote server and with with the specified user credential and new password. |
|
protected
|
doResetPassword(AuthenticationConnection<T> connection,
String login,
String newPassword)
Does the password reset by using the specified connection with the remote server the user login for which the password has to be reset and a new password. |
|
String |
getServerName()
Gets the name of the authentication server with which this authentication communicates. |
|
void |
init(String authenticationServerName,
ResourceLocator settings)
Initializes this authentication with the specified settings to communicate with a server of an authentication service. |
|
boolean |
isEnabled()
Is this authentication enabled? |
|
protected abstract void |
loadProperties(ResourceLocator settings)
Loads the specified properties to set the communication information with the authentication service. |
|
protected abstract
|
openConnection()
Opens a connection with a server of the remote authentication service. |
|
void |
resetPassword(String login,
String newPassword)
Resets the password associated with the specified login of a user with the new specified one. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String module
protected boolean enabled
public static final String ENC_TYPE_UNIX
public static final String ENC_TYPE_MD5
public static final String ENC_TYPE_CLEAR
public static final String PASSWORD_IS_ABOUT_TO_EXPIRE
public static final String PASSWORD_CHANGE_ALLOWED
| Constructor Detail |
|---|
public Authentication()
| Method Detail |
|---|
public boolean isEnabled()
public String getServerName()
public void init(String authenticationServerName,
ResourceLocator settings)
authenticationServerName - the name of a remote service behind a given authentication service.settings - the settings of the server communication.
public void authenticate(AuthenticationCredential credential)
throws AuthenticationException
credential - the credential to use to authenticate the user.
AuthenticationException - if an error occurs while authenticating the user.
public void changePassword(AuthenticationCredential credential,
String newPassword)
throws AuthenticationException
credential - the user credential used in an authentication with Silverpeas.newPassword - user new password
AuthenticationException - if an error occurs while changing the user password.
public void resetPassword(String login,
String newPassword)
throws AuthenticationException
login - the user loginnewPassword - the new password
AuthenticationException - if an error occurs while resetting the user password.protected abstract void loadProperties(ResourceLocator settings)
settings - the communication settings.
protected abstract <T> AuthenticationConnection<T> openConnection()
throws AuthenticationException
T - the type of the authentication server's connector.
AuthenticationException - if no connection can be established with a server of the remote
authentication service.
protected abstract <T> void closeConnection(AuthenticationConnection<T> connection)
throws AuthenticationException
T - the type of the authentication server's connector.connection - the connection with a remote authentication server.
AuthenticationException - if no connection was previously opened or if the connection
cannot be closed for any reason.
protected abstract <T> void doAuthentication(AuthenticationConnection<T> connection,
AuthenticationCredential credential)
throws AuthenticationException
T - the type of the authentication server's connector.connection - the connection with a remote authentication server.credential - the credential to use to authenticate the user.
AuthenticationException - if an error occurs while authenticating the user.
protected <T> void doChangePassword(AuthenticationConnection<T> connection,
AuthenticationCredential credential,
String newPassword)
throws AuthenticationException
T - the type of the authentication server's connector.connection - the connection with a remote authentication server.credential - the credential to use to authenticate the user.newPassword - the new password that will replace the one in the user credential.
AuthenticationException - if an error occurs while changing the user password.
protected <T> void doResetPassword(AuthenticationConnection<T> connection,
String login,
String newPassword)
throws AuthenticationException
T - the type of the authentication server's connector.connection - the connection with a remote authentication server.login - the login of the user for which the password has to be reset.newPassword - the new password with which the user password will be reset.
AuthenticationException - if an error occurs while resetting the user password.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||