public class AuthenticationManager extends Object implements IAuthenticationManager
Constructor and Description |
---|
AuthenticationManager() |
Modifier and Type | Method and Description |
---|---|
void |
clearInactiveSessions(SessionConfig sessionConfig,
int minutes,
ITransaction transaction)
Deletes the sessions inactive for the specified amount of minutes.
|
boolean |
clearThreadData()
Clears
session config's thread data. |
void |
endImpersonation(SessionConfig sessionConfig)
Ends an impersonation in the
current thread, that has been started by
IAuthenticationManager.impersonate(String) . |
static String |
generateSessionId()
Generates a new session identifier.
|
Collection<SessionConfig> |
getSessionsByUserId(SessionConfig sessionConfig,
String userId,
ITransaction transaction)
Returns a collection of active session objects for the given user.
|
String |
getUserIdBySessionId(SessionConfig sessionConfig,
ITransaction transaction)
Deprecated.
|
SessionConfig |
impersonate(String userId)
The authenticated user in the current thread impersonates another user.
|
void |
keepSessionAlive(SessionConfig sessionConfig)
Keeps the specified session alive by updating the last time the session was used.
|
SessionConfig |
login(String login,
String password,
ITransaction transaction)
Logins a user using the specified password as his credentials, and returns
the new SessionConfig for the logged in user.
|
SessionConfig |
login(String securityAlias,
String login,
String password,
ITransaction transaction)
Logins a user using the specified JAAS security alias, password as his credentials, and returns
the new SessionConfig for the logged in user.
|
String |
loginFramworkClockUser(ITransaction transaction)
Deprecated.
|
SessionConfig |
loginUser(String userId,
ITransaction transaction)
Logins a user without performing any authentication.
|
String |
loginUser(String login,
String password,
ITransaction transaction)
Deprecated.
|
String |
loginUserGuest()
Deprecated.
|
void |
logoutUser(SessionConfig sessionConfig,
ITransaction transaction)
Close the user's session given the userSession and the transaction.
|
boolean |
validateSessionId(SessionConfig sessionConfig,
ITransaction transaction)
Validate the session of the User given the userSession and transaction.
|
public boolean validateSessionId(SessionConfig sessionConfig, ITransaction transaction) throws ManagerException, PortalException
IAuthenticationManager
validateSessionId
in interface IAuthenticationManager
ManagerException
PortalException
@Deprecated public String getUserIdBySessionId(SessionConfig sessionConfig, ITransaction transaction) throws ManagerException, PortalException
IAuthenticationManager
getUserIdBySessionId
in interface IAuthenticationManager
ManagerException
PortalException
@Deprecated public String loginFramworkClockUser(ITransaction transaction) throws ManagerException, PortalException
IAuthenticationManager
loginFramworkClockUser
in interface IAuthenticationManager
ManagerException
PortalException
@Deprecated public String loginUser(String login, String password, ITransaction transaction) throws ManagerException, PortalException
IAuthenticationManager
loginUser
in interface IAuthenticationManager
ManagerException
PortalException
public SessionConfig login(String login, String password, ITransaction transaction) throws ManagerException, PortalException
IAuthenticationManager
login
in interface IAuthenticationManager
login
- the user's login.password
- the user's password.transaction
- the transaction for persistence access.PortalException
ManagerException
IAuthenticationManager.loginUser(String, ITransaction)
public SessionConfig login(String securityAlias, String login, String password, ITransaction transaction) throws ManagerException, PortalException
IAuthenticationManager
login
in interface IAuthenticationManager
securityAlias
- the JAAS security alias to use. If null, the default security alias
specified in the lumisportalconfig.xml file is used.login
- the user's login.password
- the user's password.transaction
- the transaction for persistence access.PortalException
ManagerException
IAuthenticationManager.loginUser(String, ITransaction)
public SessionConfig loginUser(String userId, ITransaction transaction) throws PortalException
IAuthenticationManager
loginUser
in interface IAuthenticationManager
userId
- the userId.transaction
- the transaction for persistence access.PortalException
public void logoutUser(SessionConfig sessionConfig, ITransaction transaction) throws ManagerException, PortalException
IAuthenticationManager
logoutUser
in interface IAuthenticationManager
ManagerException
PortalException
@Deprecated public String loginUserGuest() throws ManagerException, PortalException
IAuthenticationManager
loginUserGuest
in interface IAuthenticationManager
ManagerException
PortalException
public void clearInactiveSessions(SessionConfig sessionConfig, int minutes, ITransaction transaction) throws ManagerException, PortalException
IAuthenticationManager
clearInactiveSessions
in interface IAuthenticationManager
ManagerException
PortalException
public void keepSessionAlive(SessionConfig sessionConfig) throws ManagerException, PortalException
IAuthenticationManager
keepSessionAlive
in interface IAuthenticationManager
ManagerException
PortalException
public SessionConfig impersonate(String userId) throws PortalException
IAuthenticationManager
IAuthenticationManager.endImpersonation(SessionConfig)
to end an impersonation
initiated by this method.impersonate
in interface IAuthenticationManager
userId
- the user id.PortalException
public void endImpersonation(SessionConfig sessionConfig) throws PortalException
IAuthenticationManager
IAuthenticationManager.impersonate(String)
.endImpersonation
in interface IAuthenticationManager
sessionConfig
- the impersonated session config.PortalException
public Collection<SessionConfig> getSessionsByUserId(SessionConfig sessionConfig, String userId, ITransaction transaction) throws PortalException
IAuthenticationManager
getSessionsByUserId
in interface IAuthenticationManager
PortalException
public boolean clearThreadData()
session config's
thread
data.true
if there was data to be cleared or false
if the thread data was already clear.public static String generateSessionId()
SecureRandom
, incremental integer and current time.LumisXP 12.2.0.200122 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.