RE: Liferay 7.4 Restrict Access to a Page without Sign in

Jamie Sammons, modified 2 Years ago. New Member Posts: 18 Join Date: 4/11/23 Recent Posts

I have created a page named dashboard in the Liferay portal, but this page is public and accessible to all without Signin using following URL.

http://localhost:8080/dashboard

How I can restrict users from viewing this page without Signin. The requirement is if user hits the URL "http://localhost:8080/dashboard" without login it should route to the Home page (http://localhost:8080/home or http://localhost:8080), there user can do the Signin, after successfull Signin user should be navigated to the Dashboard page (http://localhost:8080/dashboard). 

I have tried setting the page permissions, but its showing "404 page not found" if user hits "http://localhost:8080/dashboard" without Signin, in my case it should redirect to home page.

Below are the questions I would like to get help from the community.

1) How we can restrict a page can be viewable for Signed-in users?

2) How we can redirect to the home page if user accessing a resgtricted page instead of showing 404 page not found?

3) How we can redirect to a specific page (example http://localhost:8080/dashboard) after successfull Signin?

I am using Liferay version 7.4.3.74.

thumbnail
David H Nebinger, modified 2 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

Just remove guest view permission from the page.

thumbnail
Jamie Sammons, modified 2 Years ago. New Member Posts: 6 Join Date: 10/5/15 Recent Posts

1) What Dave said

2) You will have to enable the "Login Prompt", which is disabled by default. This can either be done in the System, Instance or Site Settings und "Security - Login"

3) This should work automatically