Foren
restrict one session per user
Jigar N Gajjar, geändert vor 13 Jahren.
restrict one session per user
Junior Member Beiträge: 71 Beitrittsdatum: 25.12.09 Neueste Beiträge
Hi,
i dont want user to allow to login from the multiple pc, if user has already logged from one pc and tried to login from the another pc, the first session should be logged out, how can i do that?
i dont want user to allow to login from the multiple pc, if user has already logged from one pc and tried to login from the another pc, the first session should be logged out, how can i do that?
Corné A, geändert vor 13 Jahren.
RE: restrict one session per user
Liferay Legend Beiträge: 1313 Beitrittsdatum: 03.10.06 Neueste Beiträge
Implement your own AutoLogin implementation based on ip adress;
com.liferay.portal.security.auth.AutoLogin
iterate all session and find the #1's Session on Userid and remove it
com.liferay.portal.security.auth.AutoLogin
##
## Auto Login
##
#
# Input a list of comma delimited class names that implement
# com.liferay.portal.security.auth.AutoLogin. These classes will run in
# consecutive order for all unauthenticated users until one of them return a
# valid user id and password combination. If no valid combination is
# returned, then the request continues to process normally. If a valid
# combination is returned, then the portal will automatically login that
# user with the returned user id and password combination.
#
# For example, com.liferay.portal.security.auth.RememberMeAutoLogin reads
# from a cookie to automatically log in a user who previously logged in
# while checking on the "Remember Me" box.
#
# This interface allows deployers to easily configure the portal to work
# with other SSO servers. See com.liferay.portal.security.auth.CASAutoLogin
# for an example of how to configure the portal with Yale's SSO server.
#
auto.login.hooks=com.liferay.portal.security.auth.CASAutoLogin,com.liferay.portal.security.auth.NtlmAutoLogin,com.liferay.portal.security.auth.OpenIdAutoLogin,com.liferay.portal.security.auth.OpenSSOAutoLogin,com.liferay.portal.security.auth.RememberMeAutoLogin,com.liferay.portal.security.auth.SiteMinderAutoLogin
iterate all session and find the #1's Session on Userid and remove it
Jigar N Gajjar, geändert vor 13 Jahren.
RE: restrict one session per user
Junior Member Beiträge: 71 Beitrittsdatum: 25.12.09 Neueste Beiträge
Hi,
can you tell me how to iterate all session in liferay?
can you tell me how to iterate all session in liferay?
Corné A, geändert vor 13 Jahren.
RE: restrict one session per user
Liferay Legend Beiträge: 1313 Beitrittsdatum: 03.10.06 Neueste Beiträge
You could look at the PortletSessionTracker or learn from the code
\portal-web\docroot\html\portlet\enterprise_admin\view_monitoring.jsp
or implement your own sessionlistener
\portal-web\docroot\html\portlet\enterprise_admin\view_monitoring.jsp
Map<string, usertracker> sessionUsers = LiveUsers.getSessionUsers(company.getCompanyId());
</string,>
or implement your own sessionlistener
Juan M. Gomez, geändert vor 12 Jahren.
RE: restrict one session per user
Junior Member Beiträge: 69 Beitrittsdatum: 07.11.07 Neueste BeiträgeCorné Aussems:
You could look at the PortletSessionTracker or learn from the code
\portal-web\docroot\html\portlet\enterprise_admin\view_monitoring.jspMap<string, usertracker> sessionUsers = LiveUsers.getSessionUsers(company.getCompanyId()); </string,>
or implement your own sessionlistener
Hello there Corné, I'm trying to accomplish this behavior and so far I have been able to drop logged user from the LiveUsers list by using
LiveUsers.signOut(PortalUtil.getCompanyId(request), userTracker.getUserId(), userTracker.getSessionId());
however, the User is still logged in the portal and I'm not been able to log the old session out.. Can you point me in the right direction?I also took a look at LogoutAction code but using it is logging out the new session that is created (the one coming from the request), and not the one that already exists (the one in LiveUsers list). Is there a way to get the Session object from the UserTracker to invalidate it? I'm using Liferay EE 6.0.
Thanks in advance.
manish dadheech, geändert vor 9 Jahren.
RE: restrict one session per user
New Member Beiträge: 3 Beitrittsdatum: 17.03.14 Neueste Beiträge
Hi you can use
PortletSessionTracker.invalidate(userTracker.getSessionId());
Method for this it will be helpfull for you....
PortletSessionTracker.invalidate(userTracker.getSessionId());
Method for this it will be helpfull for you....