掲示板

Validating User session in Liferay Faces

9年前 に Venu Pattamatta によって更新されました。

Validating User session in Liferay Faces

Junior Member 投稿: 29 参加年月日: 14/05/29 最新の投稿
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
9年前 に Juan Gonzalez によって更新されました。

RE: Validating User session in Liferay Faces

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
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.
9年前 に Venu Pattamatta によって更新されました。

RE: Validating User session in Liferay Faces

Junior Member 投稿: 29 参加年月日: 14/05/29 最新の投稿
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
9年前 に Juan Gonzalez によって更新されました。

RE: Validating User session in Liferay Faces (回答)

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
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
9年前 に Venu Pattamatta によって更新されました。

RE: Validating User session in Liferay Faces

Junior Member 投稿: 29 参加年月日: 14/05/29 最新の投稿
Hi,

Thanks for the info.