Class FormBaseModel
- Direct Known Subclasses:
AuthModel
,RegistrationModel
This class manages the the auth services and the user database which an authentication model will use to implement a form..
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFormBaseModel
(AuthService baseAuth, AbstractUserDatabase users) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOAuth
(OAuthService auth) Adds an OAuth authentication service provider.void
addOAuth
(List<OAuthService> auth) Adds a list of OAuth authentication service providers.void
Adds a password authentication service.Returns the authentication base service.getOAuth()
Returns the list of OAuth authentication service providers.Returns the password authentication service.getUsers()
Returns the user database.Returns a field label.final boolean
Logs the user in.boolean
loginUser
(Login login, User user, LoginState state) Logs the user in.protected void
protected void
setValid
(String field, CharSequence message) Methods inherited from class eu.webtoolkit.jwt.WFormModel
addField, addField, getFields, getValidation, getValidator, getValue, isReadOnly, isValid, isValidated, isVisible, removeField, reset, setReadOnly, setValidated, setValidation, setValidator, setValue, setVisible, validate, validateField, valueText
Methods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, setFormData, setObjectName, tr
-
Field Details
-
LoginNameField
Login
name field.- See Also:
-
-
Constructor Details
-
FormBaseModel
Constructor.
-
-
Method Details
-
getBaseAuth
Returns the authentication base service.This returns the service passed through the constructor.
-
getUsers
Returns the user database. -
addPasswordAuth
Adds a password authentication service.This enables password-based registration, including choosing a proper password.
Only one password authentication service can be configured.
- See Also:
-
getPasswordAuth
Returns the password authentication service. -
addOAuth
Adds an OAuth authentication service provider.This enables OAuth-based registration. More than one OAuth authentication service can be configured: one for each supported third-party OAuth identity provider.
-
addOAuth
Adds a list of OAuth authentication service providers.- See Also:
-
getOAuth
Returns the list of OAuth authentication service providers.- See Also:
-
label
Description copied from class:WFormModel
Returns a field label.The default implementation returns the WString::tr(field)
- Overrides:
label
in classWFormModel
-
loginUser
Logs the user in.Logs in the user, after checking whether the user can actually be logged in. A valid user may be refused to login if its account is disabled (see
User.getStatus()
) or if it's email address is unconfirmed and email confirmation is required.Returns whether the user could be logged in.
-
loginUser
Logs the user in. -
setValid
-
setValid
-