Redirect private pages to login

Jamie Sammons, modified 3 Years ago. New Member Post: 1 Join Date: 2/1/22 Recent Posts

Hi comunity,

I'm using liferay-ce-portal-7.4.3.4-ga4 version and I have built a website with a public login page and the remaining pages are all private. I have configured to redirect to login page when user session expires, which working well, but I also need to redirect to login page when someone tries to access a private page without logged in previously, i.e. when someone tries to access it as Guest. Instead redirecting to login page it's redirecting to the default not found page.

So how could it be redirected to login page like when user session expires ? Is it a good idea to create a filter hook to do this redirect ?

thumbnail
Andrew Jardine, modified 3 Years ago. Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts

Hey Rui,

This is something new that was recently changed based on a security fix. You should now see a Control > System Settings > Login section. In there you will find the setting you need, which is unchecked by default. If you check that box and save, then you should go back to the expected (and historic!) behaviour. 

Lee Jordan, modified 3 Years ago. Expert Posts: 449 Join Date: 5/26/15 Recent Posts

Checkboxes are awesome. Make it rain checkboxes. Would be great here for a third option "Request Access". So that for Intranet users, say they land on a private page that's actually good, they've been sent internally by email and the site admin has set up the site securely for collaboration. They don't have access so rather than saying 404, here the previous functionality was fine because it would prompt that person to ask for access.

Sooooo have a form on the permission denied page, can I request access to the page. For us we're an intranet, we don't partculary care if someone gets a permission denied page because getting a 404 page would prompt. the user to say "nevermind, they musthave deleted the page or the link is wrong" and they then wouldn't ask the right question. The request would go back to help desk and they wouldn't know it was a permission issue.

It's another example where Liferay are making changes for quite small site installs or "commerce sites" with a few pages and perhaps overlooking again the need of an Intranet or Information Portal.

I mean if Liferay is going to be a paired down version of Wix or GoDaddy for baby sites, sure this makes sense, the site is public facing it would be a secuirty enhancement. This change doesn't seem to add up for our use case of collaboration and teams and intranets, we'd be better served by Sharepoint in this regard.

Olaf Kock, modified 1 Year ago. New Member Post: 1 Join Date: 4/5/24 Recent Posts

For Liferay 7.4, You can go to Configuration - Instance Settings

and then Security - Login  and checked "Prompt Enabled"