Package ome.security.auth
Class JdbcPasswordProvider
- java.lang.Object
-
- ome.security.auth.ConfigurablePasswordProvider
-
- ome.security.auth.JdbcPasswordProvider
-
- All Implemented Interfaces:
PasswordProvider
,PasswordUtility
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
JdbcHashedPasswordProvider
public class JdbcPasswordProvider extends ConfigurablePasswordProvider
CentralPasswordProvider
which uses the "password" table in the central OMERO database.- Since:
- 4.0
-
-
Field Summary
-
Fields inherited from class ome.security.auth.ConfigurablePasswordProvider
ctx, hash, ignoreUnknown, legacyUtil, log, salt, util
-
-
Constructor Summary
Constructors Constructor Description JdbcPasswordProvider(PasswordUtil util)
JdbcPasswordProvider(PasswordUtil util, boolean ignoreUnknown)
JdbcPasswordProvider(PasswordUtil util, boolean ignoreUnknown, boolean salt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changePassword(java.lang.String user, java.lang.String password)
Throws by default.protected void
changePassword(java.lang.String user, java.lang.String password, PasswordUtil.METHOD method)
Actually perform the password change in the database and log the event against the user.java.lang.Boolean
checkPassword(java.lang.String user, java.lang.String password, boolean readOnly)
Retrieves password from the database and callsConfigurablePasswordProvider.comparePasswords(String, String)
.boolean
hasPassword(java.lang.String user)
Always returns false, override with specific logic.-
Methods inherited from class ome.security.auth.ConfigurablePasswordProvider
comparePasswords, comparePasswords, comparePasswords, encodePassword, encodePassword, encodeSaltedPassword, loginAttempt, setApplicationContext, setLegacyUtil
-
-
-
-
Constructor Detail
-
JdbcPasswordProvider
public JdbcPasswordProvider(PasswordUtil util)
-
JdbcPasswordProvider
public JdbcPasswordProvider(PasswordUtil util, boolean ignoreUnknown)
-
JdbcPasswordProvider
public JdbcPasswordProvider(PasswordUtil util, boolean ignoreUnknown, boolean salt)
-
-
Method Detail
-
hasPassword
public boolean hasPassword(java.lang.String user)
Description copied from class:ConfigurablePasswordProvider
Always returns false, override with specific logic.- Specified by:
hasPassword
in interfacePasswordProvider
- Overrides:
hasPassword
in classConfigurablePasswordProvider
-
checkPassword
public java.lang.Boolean checkPassword(java.lang.String user, java.lang.String password, boolean readOnly)
Retrieves password from the database and callsConfigurablePasswordProvider.comparePasswords(String, String)
. Uses default logic if user is unknown.- Specified by:
checkPassword
in interfacePasswordProvider
- Overrides:
checkPassword
in classConfigurablePasswordProvider
-
changePassword
public void changePassword(java.lang.String user, java.lang.String password) throws PasswordChangeException
Description copied from class:ConfigurablePasswordProvider
Throws by default.- Specified by:
changePassword
in interfacePasswordProvider
- Overrides:
changePassword
in classConfigurablePasswordProvider
- Throws:
PasswordChangeException
-
changePassword
protected void changePassword(java.lang.String user, java.lang.String password, PasswordUtil.METHOD method) throws PasswordChangeException
Actually perform the password change in the database and log the event against the user.- Parameters:
user
- the name of the user whose password is to be changedpassword
- the password to prepare for storing in the tablemethod
- how the given password is to be stored- Throws:
PasswordChangeException
- if the operation failed
-
-