T
- type of AppUSerpublic abstract class PasswordAuthComposite<T extends AppUser> extends AppUserComposite<T,PasswordAuthComposite<T>> implements AppUserTransitionContributor, NewSignupAction<T>, RequiredPageProvider<T>
Composite
that implements password authentication.
If a AppUserFactory
contains a composite of this type then it supports password authentication
different sub-classes support different mechanismsModifier and Type | Class and Description |
---|---|
class |
PasswordAuthComposite.PasswordResetRequiredPage |
class |
PasswordAuthComposite.UpdatePasswordTransition |
Modifier and Type | Field and Description |
---|---|
static CurrentUserKey |
CHANGE_PASSWORD |
static Feature |
USER_CHANGE_PASSWORD_FEATURE |
Modifier | Constructor and Description |
---|---|
protected |
PasswordAuthComposite(AppUserFactory<T> fac) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canResetPassword(T user)
Is it legal to reset the password for the current user.
|
abstract boolean |
checkPassword(T u,
java.lang.String password)
Check if a string matches this persons password.
|
boolean |
doWelcome(T person)
Should we show a welcome page for new users.
|
abstract T |
findByLoginNamePassword(java.lang.String name,
java.lang.String password)
Check a supplied user-name and password.
|
abstract T |
findByLoginNamePassword(java.lang.String name,
java.lang.String password,
boolean check_fail_count)
Check a supplied user-name and password.
|
abstract java.lang.String |
firstPassword(T user)
set the initial randomised password for the user
|
java.util.Set<RequiredPage<T>> |
getRequiredPages()
Get the set of required pages.
|
java.util.Map<AppUserKey,Transition<AppUser>> |
getTransitions(AppUserTransitionProvider provider) |
protected java.lang.Class<? super PasswordAuthComposite<T>> |
getType()
Returns the type the composite should be registered under.
|
abstract void |
lockPassword(T user)
lock the account so no password works.
|
abstract boolean |
mustResetPassword(T user)
Is the user required to change their password
|
abstract void |
newPassword(T user)
Set a new randomised password for the user and send a notification email
|
void |
newSignup(T user) |
abstract java.lang.String |
randomisePassword(T user)
set a new randomised password for the user
|
abstract java.lang.String |
reasonForReset(T user)
Text explanation of why
mustResetPassword(AppUser) returned true. |
abstract void |
setPassword(T user,
java.lang.String password)
Change the password for a user
|
addDefaults, addFieldHelp, addOptional, addSelectors, addSuppress, addTranslations, customiseForm, customiseUpdateForm, getContext, getFactory, getLogger, getRecord, getRepository, modifyDefaultTableSpecification, postUpdate, preRegister, release, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFieldConstraints, addFormFields
public static final Feature USER_CHANGE_PASSWORD_FEATURE
public static CurrentUserKey CHANGE_PASSWORD
protected PasswordAuthComposite(AppUserFactory<T> fac)
fac
- protected java.lang.Class<? super PasswordAuthComposite<T>> getType()
Composite
public abstract boolean checkPassword(T u, java.lang.String password)
u
- AppUser to checkpassword
- unencrypted password to check.public abstract T findByLoginNamePassword(java.lang.String name, java.lang.String password) throws DataException
name
- password
- DataException
public abstract T findByLoginNamePassword(java.lang.String name, java.lang.String password, boolean check_fail_count) throws DataException
name
- password
- check_fail_count
- set to false to ignore failed logins.DataException
public abstract boolean canResetPassword(T user)
user
- or null for general testpublic abstract boolean mustResetPassword(T user)
user
- public abstract java.lang.String reasonForReset(T user)
mustResetPassword(AppUser)
returned true.user
- public abstract void setPassword(T user, java.lang.String password) throws DataFault
user
- password
- clear-text passwordDataFault
public abstract void lockPassword(T user) throws DataFault
user
- DataFault
public abstract void newPassword(T user) throws java.lang.Exception
user
- java.lang.Exception
public abstract java.lang.String randomisePassword(T user) throws DataFault
user
- DataFault
public abstract java.lang.String firstPassword(T user) throws DataFault
user
- DataFault
public boolean doWelcome(T person)
person
- public void newSignup(T user) throws java.lang.Exception
newSignup
in interface NewSignupAction<T extends AppUser>
java.lang.Exception
public java.util.Map<AppUserKey,Transition<AppUser>> getTransitions(AppUserTransitionProvider provider)
getTransitions
in interface AppUserTransitionContributor
public java.util.Set<RequiredPage<T>> getRequiredPages()
RequiredPageProvider
getRequiredPages
in interface RequiredPageProvider<T extends AppUser>