public abstract class LoginProcessor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GUEST_LOGIN_SOURCE
The login source for the guest login.
|
static com.inet.logging.Logger |
LOGGER
The authentication logger.
|
static java.lang.String |
MASTER_LOGIN_ID
The login ID for the master login.
|
static java.lang.String |
MASTER_LOGIN_SOURCE
The login source for the master login.
|
static java.lang.String |
SYSTEM_LOGIN_SOURCE
The login source for all logins that come from the underlying system.
|
Modifier | Constructor and Description |
---|---|
protected |
LoginProcessor(AuthenticationDescription description)
Create a new LoginProcessor
|
Modifier and Type | Method and Description |
---|---|
com.inet.usersandgroups.api.user.LoginSettings |
createLoginSettings(java.lang.String loginID)
Create a LoginSettings for the given loginID
|
static void |
destroyCurrent()
Remove current LoginProcessor from current thread.
|
AuthenticationDescription |
getAuthenticationDescription()
Get the AuthenticationDescription for creating this login processor.
|
static LoginProcessor |
getCurrent()
Get the login processor for the current request session/thread.
|
abstract java.lang.String |
getLoginID()
Returns the user ID of the logged in user, or null if the user is not logged in.
|
abstract java.lang.String |
getLoginSource()
Get an unique ID for the source of the login.
|
protected com.inet.usersandgroups.api.user.UserAccount |
getOrCreateUserAccount(java.lang.String loginID)
Get user account from the user manager or create if not exists.
|
com.inet.id.GUID |
getUserAccountID()
Get the id of the account or null if not login.
|
com.inet.id.GUID |
getUserAccountID(java.lang.Runnable callbackAfterLogin)
Get the id of the account or null if not login.
|
UserAccountType |
getUserAccountType()
The account type determine some possible features of a user and/or login.
|
protected boolean |
isCreateUserAccountSupported()
If the creation of new login user supported.
|
boolean |
isNewUser()
If the user was a new user in this browser session.
|
boolean |
isSameAccount(java.lang.String loginID,
char[] passwordChars,
com.inet.usersandgroups.api.user.LoginSettings login)
Check if the given LoginSettings match this LoginProcessor settings.
|
abstract boolean |
isWebUserInRole(java.lang.String role)
Returns true if the current user is member of the given role/group.
|
static void |
setCurrent(LoginProcessor login)
Sets the specified
LoginProcessor as the info for the current request session/thread. |
static void |
setCurrentForAllThreads(LoginProcessor login)
Set the LoginProcessor from the designer.
|
T |
unwrap(java.lang.Class<T> clazz)
Returns an object that implements the given interface to allow access to
non-standard methods, or standard methods not exposed by the proxy.
|
public static final java.lang.String SYSTEM_LOGIN_SOURCE
public static final java.lang.String MASTER_LOGIN_SOURCE
public static final java.lang.String MASTER_LOGIN_ID
public static final java.lang.String GUEST_LOGIN_SOURCE
public static final com.inet.logging.Logger LOGGER
protected LoginProcessor(AuthenticationDescription description)
description
- the AuthenticationDescription for creating this login processor@Nullable public AuthenticationDescription getAuthenticationDescription()
@Nullable public com.inet.id.GUID getUserAccountID()
@Nullable public com.inet.id.GUID getUserAccountID(java.lang.Runnable callbackAfterLogin)
callbackAfterLogin
- is called if there was an login@Nullable protected com.inet.usersandgroups.api.user.UserAccount getOrCreateUserAccount(@Nonnull java.lang.String loginID)
isCreateUserAccountSupported()
returns false then this can return null.loginID
- the login IDcom.inet.http.ClientMessageException
- if there should be displayed a message to the client like a deactivated user@Nonnull public com.inet.usersandgroups.api.user.LoginSettings createLoginSettings(java.lang.String loginID)
loginID
- the current IDprotected boolean isCreateUserAccountSupported()
@Nonnull public abstract java.lang.String getLoginSource()
@Nullable public abstract java.lang.String getLoginID()
@Nonnull public UserAccountType getUserAccountType()
public abstract boolean isWebUserInRole(java.lang.String role)
role
- - Role of web userpublic boolean isNewUser()
public T unwrap(java.lang.Class<T> clazz)
clazz
- A Class defining an interface that the result must implement.public static void setCurrentForAllThreads(LoginProcessor login)
login
- - the LoginProcessorpublic static void setCurrent(LoginProcessor login)
LoginProcessor
as the info for the current request session/thread.login
- the LoginProcessor
for the current thread or null to remove itpublic static void destroyCurrent()
@Nullable public static LoginProcessor getCurrent()
public boolean isSameAccount(@Nonnull java.lang.String loginID, @Nullable char[] passwordChars, com.inet.usersandgroups.api.user.LoginSettings login)
loginID
- the login ID to checkpasswordChars
- optional password characters to validatelogin
- login settings from UserManagerCopyright © 1999-2020 by i-net software GmbH