Fórumok

Validating User session in Liferay Faces

Venu Pattamatta, módosítva 9 év-val korábban

Validating User session in Liferay Faces

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2014.05.29. Legújabb bejegyzések
Hi,

We are porting a plain primefaces based web application onto liferay portal. We used to maintain the user session using a PhaseListener that was registered using faces-config.xml which used to check the user in session and redirect to login if there is no user in the session. Is there a recommendation for this in Liferay Faces. How do we redirect to login if we cannot find the user in session.

Thanks,
Venu.
thumbnail
Juan Gonzalez, módosítva 9 év-val korábban

RE: Validating User session in Liferay Faces

Liferay Legend Bejegyzések: 3089 Csatlakozás dátuma: 2008.10.28. Legújabb bejegyzések
Hi Venu,

Liferay to the rescue!

For doing that, you can place your portlets in any Liferay private page and set the permissions for that page accordingly. If some user tries to access that page it will be redirected to your Liferay login page.

Inside your Liferay JSF portlet you can use some of the available tools for getting the current user (LiferayFacesContext) and render components as you may need.

Of course then you should remove that check in your PhaseListener, as it doesn't make sense inside Liferay.
Venu Pattamatta, módosítva 9 év-val korábban

RE: Validating User session in Liferay Faces

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2014.05.29. Legújabb bejegyzések
Hi,

I have moved the pages to the private page. But in order to make it accessible to other users in an organization what has to be done.

Thanks,
Venu.
thumbnail
Juan Gonzalez, módosítva 9 év-val korábban

RE: Validating User session in Liferay Faces (Válasz)

Liferay Legend Bejegyzések: 3089 Csatlakozás dátuma: 2008.10.28. Legújabb bejegyzések
Private Pages from a Site can only be vieweded by members of Site unless you change those page permissions.

Please read the user guide:

https://www.liferay.com/documentation/liferay-portal/6.2/user-guide/-/ai/leveraging-liferays-multi-site-capabili-liferay-portal-6-2-user-guide-02-en
Venu Pattamatta, módosítva 9 év-val korábban

RE: Validating User session in Liferay Faces

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2014.05.29. Legújabb bejegyzések
Hi,

Thanks for the info.