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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFormBaseModel(AuthService baseAuth, AbstractUserDatabase users) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOAuth(OAuthService auth) Adds an OAuth authentication service provider.voidaddOAuth(List<OAuthService> auth) Adds a list of OAuth authentication service providers.voidAdds 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 booleanLogs the user in.booleanloginUser(Login login, User user, LoginState state) Logs the user in.protected voidprotected voidsetValid(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, valueTextMethods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, resendFormData, setFormData, setObjectName, tr
-
Field Details
-
LoginNameField
Loginname 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.- See Also:
-
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.
- See Also:
-
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:WFormModelReturns a field label.The default implementation returns the WString::tr(field)
- Overrides:
labelin 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
-