Package ome.security.auth
Class FilePasswordProvider
- java.lang.Object
-
- ome.security.auth.ConfigurablePasswordProvider
-
- ome.security.auth.FilePasswordProvider
-
- All Implemented Interfaces:
PasswordProvider
,PasswordUtility
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class FilePasswordProvider extends ConfigurablePasswordProvider
Example password provider which uses the given file as password lookup. All entries in the file are of the form: username=password, where password is in whatever encoding is configured for theprovider
. Changing passwords is not supported.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.File
file
Flat file read on each invocation with name, value pairs in JavaProperties
notation.-
Fields inherited from class ome.security.auth.ConfigurablePasswordProvider
ctx, hash, ignoreUnknown, legacyUtil, log, salt, util
-
-
Constructor Summary
Constructors Constructor Description FilePasswordProvider(PasswordUtil util, java.io.File file)
FilePasswordProvider(PasswordUtil util, java.io.File file, boolean ignoreUnknown)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
checkPassword(java.lang.String user, java.lang.String password, boolean readOnly)
If this was constructed with theignoreUnknown
argument set totrue
, returnsnull
, since the base class knows no users.protected java.lang.Boolean
doCheckPassword(java.lang.String user, java.lang.String password, java.util.Properties p, boolean readOnly)
protected java.util.Properties
getProperties()
boolean
hasPassword(java.lang.String user)
Always returns false, override with specific logic.-
Methods inherited from class ome.security.auth.ConfigurablePasswordProvider
changePassword, comparePasswords, comparePasswords, comparePasswords, encodePassword, encodePassword, encodeSaltedPassword, loginAttempt, setApplicationContext, setLegacyUtil
-
-
-
-
Constructor Detail
-
FilePasswordProvider
public FilePasswordProvider(PasswordUtil util, java.io.File file)
-
FilePasswordProvider
public FilePasswordProvider(PasswordUtil util, java.io.File file, boolean ignoreUnknown)
-
-
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)
Description copied from class:ConfigurablePasswordProvider
If this was constructed with theignoreUnknown
argument set totrue
, returnsnull
, since the base class knows no users. Otherwise, returnsBoolean.FALSE
specifying that authentication should fail.- Specified by:
checkPassword
in interfacePasswordProvider
- Overrides:
checkPassword
in classConfigurablePasswordProvider
-
doCheckPassword
protected java.lang.Boolean doCheckPassword(java.lang.String user, java.lang.String password, java.util.Properties p, boolean readOnly)
-
getProperties
protected java.util.Properties getProperties()
-
-