Class AuthenticationSQL
- java.lang.Object
-
- org.silverpeas.core.security.authentication.AuthenticationProtocol
-
- org.silverpeas.core.security.authentication.AuthenticationSQL
-
- Direct Known Subclasses:
AuthenticationCAS
public class AuthenticationSQL extends AuthenticationProtocol
This class performs the authentication using an SQL table.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
dataSourceJndiName
protected String
loginColumnName
protected String
passwordAvailableColumnName
protected String
passwordColumnName
protected String
userTableName
-
Fields inherited from class org.silverpeas.core.security.authentication.AuthenticationProtocol
enabled, PASSWORD_CHANGE_ALLOWED, PASSWORD_IS_ABOUT_TO_EXPIRE
-
-
Constructor Summary
Constructors Constructor Description AuthenticationSQL()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, boolean loginIgnoreCase, 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.protected static Connection
getSQLConnection(AuthenticationConnection<Connection> connection)
void
loadProperties(org.silverpeas.kernel.bundle.SettingBundle 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.core.security.authentication.AuthenticationProtocol
authenticate, changePassword, getServerName, init, isEnabled, resetPassword
-
-
-
-
Method Detail
-
loadProperties
public void loadProperties(org.silverpeas.kernel.bundle.SettingBundle settings)
Description copied from class:AuthenticationProtocol
Loads the specified properties to set the communication information with the authentication service.- Specified by:
loadProperties
in classAuthenticationProtocol
- Parameters:
settings
- the communication settings.
-
openConnection
protected AuthenticationConnection<Connection> openConnection() throws AuthenticationException
Description copied from class:AuthenticationProtocol
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 classAuthenticationProtocol
- 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:AuthenticationProtocol
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 classAuthenticationProtocol
- 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:AuthenticationProtocol
Does the authentication by using the specified connection with the remote server and with with the specified user credential.- Specified by:
doAuthentication
in classAuthenticationProtocol
- 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:AuthenticationProtocol
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 classAuthenticationProtocol
- 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, boolean loginIgnoreCase, String newPassword) throws AuthenticationException
Description copied from class:AuthenticationProtocol
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 classAuthenticationProtocol
- Parameters:
connection
- the connection with a remote authentication server.login
- the login of the user for which the password has to be reset.loginIgnoreCase
- true to ignore case when comparing the login.newPassword
- the new password with which the user password will be reset.- Throws:
AuthenticationException
- if an error occurs while resetting the user password.
-
getSQLConnection
protected static Connection getSQLConnection(AuthenticationConnection<Connection> connection)
-
-