New in 5.0: Customized login pages... even per community

Until now when the user was in any place of the portal  clicked the "Sign in" link he was shown a default portal login page. Of course it was already possible to create your own customized login page using the available portlets, but the user was not redirected there when clicking the "Sign in" button.

After this improvement it is possible to let the portal know that a given page should act as the portal login page by setting a property in portal(-ext).properties. For example to set the home page of the guest community:

auth.login.url=/web/guest/home

 

But that's not all. It's also possible to have a customized login page per community. That will allow  users that are navigating a give community site to log in without going to a portal wide page. The way to achieve it is super simple and doesn't even require modifying a properties file. The community administrator can do it himself by just creating a regular community page and giving it the /login friendly URL. That's it, the portal will automatically detect such a page and will make it the login page for that community. Of course, don't forget to put the actual login portlet there :)

I'm trying to keep my blog posts short, so I've created a wiki page with more details about this functionality. Also a wiki page is better to document this feature since it can grow if more features are added. You can find it here: Customizing the portal login page.

 

Blogs
Fantastic! Will this also work for organizations?
Hi Josh,

That's a good point. The answer is *yes* organizations are also supported.

I've updated the wiki article accordingly
Hi Jorge Ferrer,

I saw ur post in the community about problems on modifying the page to reach after logging in . I posted my problem in the community forum but still decided to post here . I modified the properties in portal-ext.properties but none of them is working . I am pasting my email Id ( crazytitan05@gmail.com ) in case you the error which i am making please let me know .

I am pasting my post below

Hi ,

I was trying to implement Custom Login like you all .But i am not able to have the correct result even after doing the steps suggested by all of you for Deafault Landing Page . Please correct me if i have done wrong

1 ) I created liferay using source code available on Liferay Website and the Liferay environment is up and Ruinning .
2) I created a few public pages using the default user id Test in the already available community Liferay Los Angeles.
3) I named the first public page as home page in Liferay Los Angeles and added Sign In Portlet there .
4) I wanted that on signing in this Sign In Portlet in Home Public Page of Liferay LOS Angeles i could go land to some other Public or
private page .
5) I created another public page elearning in public page section of Liferay Los Angeles .


Actions that i had performed as stated in the forums for Deafault Landing Page :-

I copied Portal.properties file into portal-ext.properties file in ext\ext-impl\classes folder and did the following

1 ) auth.forward.by.last.path=true
2 ) default.landing.page.path=/web/44/elearning


Hower i don't see any changes .The website behavior still remains the same . what have i missed here ?? Have i placed the portal-ext .properties file correctly ??

Thanks in advance
Hey Gaurav,

Your post does not seem related to this blog entry. Please use the forums instead, since that'll make it easier for other people with a solution or with similar problems to find your description.
Hi, you say this in the wiki page (now http://www.liferay.com/web/guest/community/wiki/-/wiki/1071674/Customizing+the+portal+login+page):

"The portal will also use that page when an anonymous user tries to access a page that requires authentication and is to be redirected to the login page."

but this doesn't work for me, in this cases it always redirect to the main login page. Its a bug? Do you know Jorge if it will be fixed in the next liferay release?

thanks.
Hi Alfredo,

Which version of Liferay are you using? That works for me.

If you've build the login link yourself make sure the link to the login page has a p_l_id param so that the portal knows the source community. Also make sure the friendly URL of the custom login page is exactly /login
I'm using the last version (5.0.1) and I don't build the link myself,

I just create a page with the friendly URL "/login", and seems it works well. When I press the the "sign in" bottom in the menu Liferay redirect me to the login page of that community, but when a try to access to a private page when I'm not logged in, it redirects me to the main login page.

Then it works well for you?

Thank again Jorge Ferrer.
Hi Alfredo,

It might be an specific scenario I did not consider. Can you give me more details about the type of private page that you are trying to access? Is it a page in the same website which has been removed permissions to guest users?

Note that if it's a private page in a different website (community) then the custom login page has to be in that other community.
Don't think is any especial scenario. I download the bundle, create a new community with 2 pages in the public side: home and login (with login as friendly url). And another page in the private side: home.

I access to the public page as:

http://localhost/web/home

I click in the "sing in" button (in the menu) and liferay redirect me to:

http://localhost/web/login

So this work well. But if I try to access to:

http://localhost/group/home

It redirect me to:
http://localhost/c/portal/login?p_l_id=...

It happened the same in the new liferay release (5.1). :/

Thanks.