Hey everybody,
I have a technical question regarding creating a custom login portlet within the plugin-sdk environment.
I know this topic has been discussed to death and I have looked through a lot of the existing threads already.
Here is why our scenario is different:
We are working on a project where all of our portlets are created within the plugin-sdk environment. We have a rigid environment for each of our portlets, e.g. we use Spring MVC Portlets, Velocity, iBATIS, etc. So our portlets are using a different system from LifeRay's JSP/Struts/...
Our Portlet Environment:* LifeRay 5.1.4
* Spring MVC Portlet (note this is different from Spring MVC)
* Velocity
* ...
Our Objective: Create a login portlet that replicates LifeRay's standard login process but then does additional steps (e.g. inserts session data and initiates calls to web services from third-party systems).
Alternatives I have looked into:
1. Plugin Hooks:http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Portal+Hook+Plugins
2. Using EXT environment:http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Customizing+the+portal+login+page
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Customizing+the+default+page+after+login
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Customizing%20the%20portal%20login%20page#section-Customizing+the+portal+login+page-Advanced
Both of the above solutions revolve around "hooking" into the existing login process using the properties shown below, which are defined in portel.properties (you override them in portal-ext.properties or using the hooks mechanism):
#
# Login event
#
login.events.pre=com.liferay.portal.events.LoginPreAction
login.events.post=com.liferay.portal.events.LoginPostAction,com.liferay.portal.events.DefaultLandingPageAction
This would be fine for us except for these reasons:
1. We need to change the look and feel of the login page, but we use a system that is different from LifeRay's default JSP/Struts. We use Velocity with Spring MVC Portlet plus additional frameworks.
2. We need localization which we are implementing using our chosen frameworks.
Essentially we would like to have our login process sitting in our own portlet where we have more control over it.
Attempted Solution:I decided to use a solution of calling LifeRay's login portlet from within our own portlet. For LifeRay 5.1.4 that means leveraging com.liferay.portal.action.LoginAction. This was discussed in Ray Augé's blog article "Creating custom login front end":
http://www.liferay.com/web/rauge/blog/-/blogs/creating-custom-login-front-end?_33_redirect=%2Fweb%2Fguest%2Fcommunity%2Fblogs%3Fp_p_id%3D77%26p_p_lifecycle%3D1%26p_p_state%3Dnormal
Issue: I have managed to successfully integrate and call com.liferay.portal.action.LoginAction and other auxiliary LifeRay portal classes from within our portlet (sitting in the plugin-sdk environment). I can successfully build and deploy my custom login portlet.
However, when I go through the login process, upon completion LifeRay does not seem to realize the user is logged in. Doing some debugging I know that the standard LifeRay cookies are being set and the session contains the user data. But LifeRay does not recognize that the user is logged in (e.g. the top navigation does not update to say "Welcome <user>!" or have the signed in options).
I added some screenshots of what I run my local LifeRay server with both login portlets running (our custom Login portlet vs. LifeRay's login portlet). In LoginCompare1.jpg you can see our custom login at the top and LifeRay's login at the bottom. In the screenshot I have just logged in using our custom portlet and you can see that LifeRay does not recognize that the user is logged in.
In LoginCompare2.jpg, I have just logged in successfully using LifeRay's login portlet. LifeRay recognizes that the user is logged in and renders the view accordingly.
I feel like I am getting really close to getting this working, but I am missing some additional method calls, etc. to hook into LifeRay.
Does anyone know what I might be missing? Bitte melden Sie sich an, um diesen Inhalt als unangebracht zu kennzeichnen.