Class LoginConfiguration
- java.lang.Object
-
- com.smartfoxserver.v2.components.login.LoginConfiguration
-
public final class LoginConfiguration extends java.lang.Object
This is the main configuration object used by the Login Assistant to load data from the user's database.- See Also:
LoginAssistantComponent
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
activationErrorMessage
Customizable error message for inactive accountsjava.lang.String
activationField
An optional field to check if the user account was activated.boolean
allowGuests
If set to true it will allow guest users to enter with a temporary name.IDBManager
customDBManager
ADVANCEDboolean
customPasswordCheck
Allows to bypass the default password check.java.util.List<java.lang.String>
extraFields
An optional list of other field names to be loaded in the query and sent back in the optional SFSObject passed with the login response.java.lang.String
loginTable
The name of the Database table where user profiles are stored, default is 'users'java.lang.String
nickNameField
If the user name used for login is not to be used as the nickname of the user in the system, you can specify which other field in the database contains the nickname.java.lang.String
passwordField
The name of the field in the Database containing the user password, default is 'password'ILoginAssistantPlugin
postProcessPlugin
ADVANCEDILoginAssistantPlugin
preProcessPlugin
ADVANCEDboolean
useCaseSensitiveNameChecks
By default user name checks are not case-sensitive.java.lang.String
userNameField
The name of the field in the Database containing the user name, default is 'username'
-
Constructor Summary
Constructors Constructor Description LoginConfiguration()
-
-
-
Field Detail
-
loginTable
public java.lang.String loginTable
The name of the Database table where user profiles are stored, default is 'users'
-
userNameField
public java.lang.String userNameField
The name of the field in the Database containing the user name, default is 'username'
-
passwordField
public java.lang.String passwordField
The name of the field in the Database containing the user password, default is 'password'
-
customPasswordCheck
public boolean customPasswordCheck
Allows to bypass the default password check. This is useful for those who store the client password in the database with extra salt, thus requiring to manipulate the client password at runtime, before checking.Since the introduction of TLS encryption clients can send the password as a custom object to avoid the default hashing done in pre-TLS API.
This allows to obtain the original password on the server side in a secure way (using TLS encryption) and check it against the database, using salt etc...
NOTE: when this parameter is turned on the LoginAssistant will not perform any password check. The password check instead must be executed via custom code in the the PreProcess plugin.
For further details and examples see the documentation here:
- Since:
- 2.10
-
useCaseSensitiveNameChecks
public boolean useCaseSensitiveNameChecks
By default user name checks are not case-sensitive. Example: Kermit != kermitYou can turn this off if the above example should be detected as the same name.
-
allowGuests
public boolean allowGuests
If set to true it will allow guest users to enter with a temporary name. This is useful to let new users register an account.NOTE: In order to login as guest, clients must send an empty string for the user name and password.
NOTE 2: If you allow guest users you will want to configure the Zone permissions so that the Guest profile is restricted in the types of request that it can send. For example you may want to deny room creation, public chats, setting variables etc...
-
nickNameField
public java.lang.String nickNameField
If the user name used for login is not to be used as the nickname of the user in the system, you can specify which other field in the database contains the nickname.For example, if users log in with an email address or some other code you can specify which field in the DB contains the user's nickname. Default is null (the nickname will be the user name).
-
activationField
public java.lang.String activationField
An optional field to check if the user account was activated. The field is expected to contain 'Y' when activated and 'N' when it's not. The default value for this field is null.This convention is particularly useful when used in conjunction with the SignUpAssistantComponent
- See Also:
SignUpAssistantComponent
-
activationErrorMessage
public java.lang.String activationErrorMessage
Customizable error message for inactive accounts
-
extraFields
public java.util.List<java.lang.String> extraFields
An optional list of other field names to be loaded in the query and sent back in the optional SFSObject passed with the login response. Default is null
-
preProcessPlugin
public ILoginAssistantPlugin preProcessPlugin
ADVANCEDAllows developers to add and extra plugin class in the login flow to manipulate objects BEFORE the login credentials are verified. This can be useful for example to add extra processing to the password field, if necessary.
A possible use case is when the password is encrypted in the database and needs to be pre-processed (i.e. decrypted)
Default is null (no pre-processing is done)
- See Also:
ILoginAssistantPlugin
-
postProcessPlugin
public ILoginAssistantPlugin postProcessPlugin
ADVANCEDAllows developers to add and extra plugin class in the login flow to manipulate objects AFTER the login credentials are verified. This can be useful to add extra data in the optional SFSObject that can be sent to the client with the Login response.
Default is null (no post-processing is done)
- See Also:
ILoginAssistantPlugin
-
customDBManager
public IDBManager customDBManager
ADVANCEDA custom DatabaseManager object can be specified if there's need to user more than one database.
Default is null (the default Extension's Zone DBManager is used).
-
-