Package com.storedobject.core
Class Login
java.lang.Object
com.storedobject.core.Login
This class is used to handle the process of logging into the platform. Typically, an instance of this class needs
to be created and credentials should be set via one of the 'login' methods.
- Author:
- Syam
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canRetry()
Whether any retry left or not.void
close()
Close this so that no more actions possible.boolean
forgotPassword
(String user) For setting forgotten password.int
getType()
Get the method type used to log in.boolean
Whether login process is currently blocked or not.boolean
Whether already logged in or not.boolean
Whether logged in using the platform default password or not (The default password will be determined by thePasswordPolicy
if one is active).boolean
login
(WebBiometric biometric, String biometricID, String type, String authenticatorData, String clientDataJSON, String signature, String userHandle, boolean lockIfFailed) Set login credentials.boolean
Set login credentials.boolean
Set login credentials.boolean
Set login credentials.boolean
Set login credentials.boolean
Set login credentials.boolean
Set login credentials.boolean
Set login credentials.void
setType
(int type) Set the method type used to log in.
-
Constructor Details
-
Login
Constructor.- Parameters:
device
- Device from which the login process is initiated.
-
Login
Constructor.- Parameters:
device
- Device from which the login process is initiated.messageViewer
- Message viewer to display pre-login messages.
-
-
Method Details
-
login
-
login
Set login credentials.- Parameters:
user
- Name of the user or a digit string representing theId
of the user.password
- Password.authenticatorCode
- Extra authenticator code required - maybe, from a second device.- Returns:
- True if logged in successfully, otherwise false.
-
login
Set login credentials.- Parameters:
user
- Name of the user or a digit string representing theId
of the user.password
- Password.lockIfFailed
- Whether to lock the login if not succeeded and no retries left or not.- Returns:
- True if logged in successfully, otherwise false.
-
login
Set login credentials.- Parameters:
user
- Name of the user or a digit string representing theId
of the user.password
- Password.authenticatorCode
- Extra authenticator code required - maybe, from a second device.lockIfFailed
- Whether to lock the login if not succeeded and no retries left or not.- Returns:
- True if logged in successfully, otherwise false.
-
login
public boolean login(WebBiometric biometric, String biometricID, String type, String authenticatorData, String clientDataJSON, String signature, String userHandle, boolean lockIfFailed) Set login credentials.- Parameters:
biometric
- Biometric object of the user.biometricID
- Biometric ID of the user.type
- Type of authentication.authenticatorData
- Authenticator data.clientDataJSON
- JSON received from the client side.signature
- Signature.userHandle
- User handle.lockIfFailed
- Whether to lock the login if not succeeded and no retries left or not.- Returns:
- True if logged in successfully, otherwise false.
- See Also:
-
login
-
login
Set login credentials. (This method is used for logging in from another SO server).- Parameters:
loginBlock
- Encrypted login block sent by the other SO server.- Returns:
- True if logged in successfully, otherwise false.
-
login
Set login credentials. (This method is used for logging in from an external server).- Parameters:
loginBlock
- Encrypted login block sent by the external server.via
- The request was sent via this.- Returns:
- True if logged in successfully, otherwise false.
-
forgotPassword
-
isBlocked
public boolean isBlocked()Whether login process is currently blocked or not. (Even if it is blocked, 'admin' can still log in but biometric logins are not allowed).- Returns:
- True/false.
-
canRetry
public boolean canRetry()Whether any retry left or not.- Returns:
- True/false.
-
isLoggedIn
public boolean isLoggedIn()Whether already logged in or not.- Returns:
- True/false.
-
isWelcomePassword
public boolean isWelcomePassword()Whether logged in using the platform default password or not (The default password will be determined by thePasswordPolicy
if one is active).- Returns:
- True/false.
-
close
public void close()Close this so that no more actions possible. -
getType
public int getType()Get the method type used to log in.- Returns:
- Type code (-1: Unknown, 0: Username/password, 1: Username / password / authenticator code, 2: Biometric, 3: Login block (cross-server), 4: Auto-login).
-
setType
public void setType(int type) Set the method type used to log in.- Parameters:
type
- Type code. (SeegetType()
).
-