|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.security.auth.ConfigurablePasswordProvider
public abstract class ConfigurablePasswordProvider
Base class for most PasswordProvider
implementations, providing
configuration for default behaviors. There is no need for a subclass to
use this implementation.
SecuritySystem
,
Permissions
Field Summary | |
---|---|
protected OmeroContext |
ctx
|
protected String |
hash
Hash implementation to use for encoding passwords to check and changed passwords. |
protected boolean |
ignoreUnknown
If true, this implementation should return a null on checkPassword(String, String) if the user is unknown, otherwise
a Boolean.FALSE . |
protected org.apache.commons.logging.Log |
log
|
protected PasswordUtil |
util
|
Constructor Summary | |
---|---|
ConfigurablePasswordProvider(PasswordUtil util)
|
|
ConfigurablePasswordProvider(PasswordUtil util,
boolean ignoreUnknown)
|
Method Summary | |
---|---|
void |
changePassword(String user,
String password)
Throws by default. |
Boolean |
checkPassword(String user,
String password)
If ignoreUnknown is true, returns null, since the base class
knows no users. |
Boolean |
comparePasswords(String trusted,
String provided)
Compares the password provided by the user (unhashed) against the given trusted password. |
String |
encodePassword(String newPassword)
Encodes the password as it would be encoded for a check by comparePasswords(String, String) |
boolean |
hasPassword(String user)
Always returns false, override with specific logic. |
protected Boolean |
loginAttempt(String user,
Boolean success)
|
void |
setApplicationContext(org.springframework.context.ApplicationContext ctx)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log log
protected final String hash
protected final boolean ignoreUnknown
checkPassword(String, String)
if the user is unknown, otherwise
a Boolean.FALSE
. Default value: false
protected final PasswordUtil util
protected OmeroContext ctx
Constructor Detail |
---|
public ConfigurablePasswordProvider(PasswordUtil util)
public ConfigurablePasswordProvider(PasswordUtil util, boolean ignoreUnknown)
Method Detail |
---|
public void setApplicationContext(org.springframework.context.ApplicationContext ctx) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
protected Boolean loginAttempt(String user, Boolean success)
public boolean hasPassword(String user)
hasPassword
in interface PasswordProvider
public Boolean checkPassword(String user, String password)
ignoreUnknown
is true, returns null, since the base class
knows no users. Otherwise, return Boolean.FALSE
specifying that
authentication should fail.
checkPassword
in interface PasswordProvider
public void changePassword(String user, String password) throws PasswordChangeException
changePassword
in interface PasswordProvider
PasswordChangeException
public String encodePassword(String newPassword)
comparePasswords(String, String)
encodePassword
in interface PasswordUtility
public Boolean comparePasswords(String trusted, String provided)
Boolean.FALSE
. If the trusted password is empty (only
whitespace), return Boolean.TRUE
. Otherwise return the results of
String.equals(Object)
.
comparePasswords
in interface PasswordUtility
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta4.2.1-r8614-Beta4.2-b41
Copyright © 2009 The University of Dundee. All Rights Reserved.