Search code examples
liferayopenid

login link to liferay with openid authentication


I have a big issue with a scenario I am implementing, any help/pointers would be highly appreciated.

The scenario is as follows:

  1. User login to system 1 which is an OpenId provider for liferay portal
  2. User is being presented with a link which contains OpenId identity and an id
  3. User press the link and a new browser tab is being opened and the user is being logged into liferay portal if not authenticated redirect to system1 login page
  4. authenticate process must be done through OpenId and fetch some data from the OpenId identity provider

I found that I should use a hook that implements AutoLogin for comming for liferay and there is no problem.

The problem is authentication with OpenId and fetching data from OpenId

Can anyone help me about OpenId and how it can be integrated with Liferay


Hi every one and thanks for responses. I used this link use autologin in liferay
and then used this class 4 openid RegistrationService.java class and open id works correctly now the the problem is that in this login link we have some parameters that we have to use in other war file how can i store this parameter in session and then retrieve after authenticate with openid? regards


Solution

  • I found the solution in Session Sharing between Portlet and Servlet it works on liferay 6.1.1 First I enable the Private portlet session by Adding the following tag in the liferay-portlet.xml <private-session-attributes>true</private-session-attributes>

    To share the session between portal and portlet. Define the shared session attribute in portal-ext.properties file by configuring the following property in the property file session.shared.attributes= LIFERAY_SHARED_ , APP_SHARED_

    and then in servlet class of hook module

    HttpSession session = request.getSession(false); session.setAttribute("APP_SHARED_test",testValue);

    and then in your controller you can get value of APP_SHARED_test

    String verCode= (String)actionRequest.getPortletSession().getAttribute("APP_SHARED_ver_code",PortletSession.APPLICATION_SCOPE);