掲示板

restrict one session per user

13年前 に Jigar N Gajjar によって更新されました。

restrict one session per user

Junior Member 投稿: 71 参加年月日: 09/12/25 最新の投稿
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?
thumbnail
13年前 に Corné A によって更新されました。

RE: restrict one session per user

Liferay Legend 投稿: 1313 参加年月日: 06/10/03 最新の投稿
Implement your own AutoLogin implementation based on ip adress;

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
13年前 に Jigar N Gajjar によって更新されました。

RE: restrict one session per user

Junior Member 投稿: 71 参加年月日: 09/12/25 最新の投稿
Hi,

can you tell me how to iterate all session in liferay?
thumbnail
13年前 に Corné A によって更新されました。

RE: restrict one session per user

Liferay Legend 投稿: 1313 参加年月日: 06/10/03 最新の投稿
You could look at the PortletSessionTracker or learn from the code
\portal-web\docroot\html\portlet\enterprise_admin\view_monitoring.jsp

		Map<string, usertracker> sessionUsers = LiveUsers.getSessionUsers(company.getCompanyId());

</string,>

or implement your own sessionlistener
thumbnail
12年前 に Juan M. Gomez によって更新されました。

RE: restrict one session per user

Junior Member 投稿: 69 参加年月日: 07/11/07 最新の投稿
Corné Aussems:
You could look at the PortletSessionTracker or learn from the code
\portal-web\docroot\html\portlet\enterprise_admin\view_monitoring.jsp

		Map<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.
9年前 に manish dadheech によって更新されました。

RE: restrict one session per user

New Member 投稿: 3 参加年月日: 14/03/17 最新の投稿
Hi you can use

PortletSessionTracker.invalidate(userTracker.getSessionId());

Method for this it will be helpfull for you....