public abstract class FormAuthComposite<AU extends AppUser> extends AppUserComposite<AU,FormAuthComposite> implements TwoFactorComposite<AU>
TwoFactorComposite
s that validate using a pin-codeModifier | Constructor and Description |
---|---|
protected |
FormAuthComposite(AppUserFactory<AU> fac) |
Modifier and Type | Method and Description |
---|---|
ContentBuilder |
addExtra(ContentBuilder cb)
Add extra content when being shown a modified auth form.
|
void |
authenticated()
action to perform when authentication completed
|
protected abstract boolean |
enabled(AU user) |
protected abstract java.lang.String |
getConfigPrefix() |
protected java.lang.Class<? super FormAuthComposite> |
getType()
Returns the type the composite should be registered under.
|
abstract void |
modifyForm(AU user,
Form f)
Add two factor fields to a form.
|
boolean |
needAuth(AU user)
would a call to
TwoFactorComposite.requireAuth(AppUser) return a FormResult |
boolean |
needToken()
Do we need to send tokens via a side channel
|
FormResult |
requireAuth(AU user)
Check if two factor authentication is required.
|
protected void |
sendToken(AU user)
send side-channel tokens.
|
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
protected FormAuthComposite(AppUserFactory<AU> fac)
fac
- public final FormResult requireAuth(AU user)
TwoFactorComposite
FormResult
is returned
to validate the two-factor credential.
If authorisation in required this might send out a token via an independent communication channel
so use TwoFactorComposite.needAuth(AppUser)
unless you intent to proceed.
requireAuth
in interface TwoFactorComposite<AU extends AppUser>
user
- AppUser
to check.FormResult
or nullpublic boolean needToken()
protected void sendToken(AU user)
user
- protected abstract boolean enabled(AU user)
public abstract void modifyForm(AU user, Form f)
f
- public ContentBuilder addExtra(ContentBuilder cb)
cb
- public boolean needAuth(AU user)
TwoFactorComposite
TwoFactorComposite.requireAuth(AppUser)
return a FormResult
needAuth
in interface TwoFactorComposite<AU extends AppUser>
public void authenticated()
ok
- was it a successful authentication.protected final java.lang.Class<? super FormAuthComposite> getType()
Composite
getType
in class Composite<AU extends AppUser,FormAuthComposite>
protected abstract java.lang.String getConfigPrefix()