org.silverpeas.authentication
Class AuthenticationSQL

java.lang.Object
  extended by org.silverpeas.authentication.Authentication
      extended by org.silverpeas.authentication.AuthenticationSQL

public class AuthenticationSQL
extends Authentication

This class performs the authentication using an SQL table.


Field Summary
protected  String jdbcDriver
           
protected  String jdbcLogin
           
protected  String jdbcPassword
           
protected  String jdbcUrl
           
protected  String loginColumnName
           
protected  String passwordAvailableColumnName
           
protected  String passwordColumnName
           
protected  String userTableName
           
 
Fields inherited from class org.silverpeas.authentication.Authentication
enabled, ENC_TYPE_CLEAR, ENC_TYPE_MD5, ENC_TYPE_UNIX, module, PASSWORD_CHANGE_ALLOWED, PASSWORD_IS_ABOUT_TO_EXPIRE
 
Constructor Summary
AuthenticationSQL()
           
 
Method Summary
protected  void closeConnection(AuthenticationConnection connection)
          Closes the connection that was previously opened with the server of the remote authentication service.
protected  void doAuthentication(AuthenticationConnection connection, AuthenticationCredential credential)
          Does the authentication by using the specified connection with the remote server and with with the specified user credential.
protected  void doChangePassword(AuthenticationConnection 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  void doResetPassword(AuthenticationConnection 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.
 void loadProperties(ResourceLocator settings)
          Loads the specified properties to set the communication information with the authentication service.
protected  AuthenticationConnection<Connection> openConnection()
          Opens a connection with a server of the remote authentication service.
 
Methods inherited from class org.silverpeas.authentication.Authentication
authenticate, changePassword, getServerName, init, isEnabled, resetPassword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jdbcUrl

protected String jdbcUrl

jdbcLogin

protected String jdbcLogin

jdbcPassword

protected String jdbcPassword

jdbcDriver

protected String jdbcDriver

userTableName

protected String userTableName

loginColumnName

protected String loginColumnName

passwordColumnName

protected String passwordColumnName

passwordAvailableColumnName

protected String passwordAvailableColumnName
Constructor Detail

AuthenticationSQL

public AuthenticationSQL()
Method Detail

loadProperties

public void loadProperties(ResourceLocator settings)
Description copied from class: Authentication
Loads the specified properties to set the communication information with the authentication service.

Specified by:
loadProperties in class Authentication
Parameters:
settings - the communication settings.

openConnection

protected AuthenticationConnection<Connection> openConnection()
                                                       throws AuthenticationException
Description copied from class: Authentication
Opens a connection with a server of the remote authentication service. The policy of the connection management is left to the concrete Authentication implementation.

Specified by:
openConnection in class Authentication
Returns:
a connection with a remote authentication server.
Throws:
AuthenticationException - if no connection can be established with a server of the remote authentication service.

closeConnection

protected void closeConnection(AuthenticationConnection connection)
                        throws AuthenticationException
Description copied from class: Authentication
Closes the connection that was previously opened with the server of the remote authentication service. The policy of the connection management is left to the concrete Authentication implementation.

Specified by:
closeConnection in class Authentication
Parameters:
connection - the connection with a remote authentication server.
Throws:
AuthenticationException - if no connection was previously opened or if the connection cannot be closed for any reason.

doAuthentication

protected void doAuthentication(AuthenticationConnection connection,
                                AuthenticationCredential credential)
                         throws AuthenticationException
Description copied from class: Authentication
Does the authentication by using the specified connection with the remote server and with with the specified user credential.

Specified by:
doAuthentication in class Authentication
Parameters:
connection - the connection with a remote authentication server.
credential - the credential to use to authenticate the user.
Throws:
AuthenticationException - if an error occurs while authenticating the user.

doChangePassword

protected void doChangePassword(AuthenticationConnection connection,
                                AuthenticationCredential credential,
                                String newPassword)
                         throws AuthenticationException
Description copied from class: Authentication
Does the password change by using the specified connection with the remote server and with with the specified user credential and new password. By default, this operation is considered as not supported by the remote authentication service and throws then an UnsupportedOperationException exception. If the authentication service supports this operation, the concrete Authentication implementation has to implement this method.

Overrides:
doChangePassword in class Authentication
Parameters:
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.
Throws:
AuthenticationException - if an error occurs while changing the user password.

doResetPassword

protected void doResetPassword(AuthenticationConnection connection,
                               String login,
                               String newPassword)
                        throws AuthenticationException
Description copied from class: Authentication
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. By default, this operation is considered as not supported by the remote authentication service and throws then an UnsupportedOperationException exception. If the authentication service supports this operation, the concrete Authentication implementation has to implement this method.

Overrides:
doResetPassword in class Authentication
Parameters:
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.
Throws:
AuthenticationException - if an error occurs while resetting the user password.


Copyright © 2016 Silverpeas. All Rights Reserved.