1

Migrating this portlet to Liferay 6.2 GA4. Code worked on Websphere in its WSRP Producer but I don't believe it was created using any sort of factory. Basically I think the problem revolves around the portletRequest object here:

RenderRequest portletRequest = (RenderRequest) request
                    .getAttribute("javax.portlet.request");
            logger.info("RenderRequest request value: " + request.toString());
            logger.info("portletRequest value: " + portletRequest.toString());
            logger.info("getAttribute: " + portletRequest.getAttributeNames().toString());
            if (portletRequest != null) {
                props = (Map) portletRequest
                        .getAttribute(PortletRequest.USER_INFO);
                logger.info("These are the props: " + props);
                String userFirstName = (String) props
                        .get("user.name.given");
                logger.info("First name: " + userFirstName);

The log statements output:

2015-09-17 14:58:20,423 WARN  portlet.controller.Controller - Portlet Controller Initialized
2015-09-17 14:59:47,274 INFO  portlet.controller.Controller - New unique id: gAnsN6rBt6g-zgvmjw-8utKX
2015-09-17 14:59:47,276 INFO  portlet.controller.Controller - Set userProfileBean with gAnsN6rBt6g-zgvmjw-8utKX
2015-09-17 14:59:47,277 INFO  portlet.controller.Controller - RenderRequest request value: com.liferay.portlet.RenderRequestImpl@1b1b59d
2015-09-17 14:59:47,277 INFO  portlet.controller.Controller - portletRequest value: com.liferay.portlet.RenderRequestImpl@1b1b59d
2015-09-17 14:59:47,278 INFO  portlet.controller.Controller - getAttribute: java.util.Collections$2@a7d3e
2015-09-17 14:59:47,278 INFO  portlet.controller.Controller - These are the props: null
2015-09-17 14:59:47,280 ERROR portlet.controller.Controller - NullPointerException in Controller
java.lang.NullPointerException
    at portlet.controller.Controller.getUserProfileForView(Controller.java:338)

I have these defined in my portlet.xml:

<user-attribute> <description>FirstName</description> <name>user.name.given</name> </user-attribute> <user-attribute> <description>LastName</description> <name>user.name.family</name> </user-attribute>

Where is there nothing available in the USER_INFO attribute?

UPDATE: I just tested consuming the custom portlet locally (i.e. on same server where it is being produced) and the user authentication is propagated normally as I would expect. So there is a disconnect somewhere when consuming the portlet from a remote (Liferay) environment.

UPDATE: liferay.log is showing the following when accessing the portlet from a remote consumer.

09:09:40,369 ERROR [server info][AutoLoginFilter:261] Current URL /en_US/widget/c/portal/layout?p_auth_secret=K%2BiMpCQsduglOsYkdIUQZQMtaDM%3D&p_l_id=21504&p_p_id=MyApp_WAR_MyApp_INSTANCE_X6Sw&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_isolated=1&wsrp=1 generates exception: com.liferay.portal.NoSuchUserException: No User exists with the key {companyId=20155, screenName=adminscreen}
09:17:21,318 ERROR [server info][AutoLoginFilter:261] Current URL /en_US/widget/c/portal/layout?p_auth_secret=K%2BiMpCQsduglOsYkdIUQZQMtaDM%3D&p_l_id=21504&p_p_id=MyApp_WAR_MyApp_INSTANCE_X6Sw&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_isolated=1&_MyApp_WAR_MyApp_INSTANCE_X6Sw_action=aboutMyApp.do&&wsrp=1 generates exception: com.liferay.portal.NoSuchUserException: No User exists with the key {companyId=20155, screenName=adminscreen}
09:17:21,323 WARN  [server info][SecurityPortletContainerWrapper:630] Reject process action for /c/portal/layout on MyApp_WAR_MyApp_INSTANCE_X6Sw

UPDATE: Stack trace for my app where the NullPointer is generated:

2015-09-18 12:15:10,965 ERROR portlet.controller.Controller - NullPointerException in Controller
java.lang.NullPointerException
    at portlet.controller.Controller.getUserProfileForView(Controller.java:338)
    at portlet.controller.Controller.doView(Controller.java:64)
    at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
    at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:55)
    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655)
    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:583)
    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:656)
    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:362)
    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1213)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655)
    at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:55)
    at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
    at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
    at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:655)
    at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:138)
    at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141)
    at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
    at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156)
    at com.liferay.portal.layoutconfiguration.util.velocity.TemplateProcessor.processMax(TemplateProcessor.java:171)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
    at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
    at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
    at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
    at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
    at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
    at org.apache.velocity.Template.merge(Template.java:328)
    at org.apache.velocity.Template.merge(Template.java:235)
    at com.liferay.portal.velocity.VelocityTemplate.processTemplate(VelocityTemplate.java:112)
    at com.liferay.portal.template.AbstractTemplate.processTemplate(AbstractTemplate.java:108)
    at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doProcessTemplate(RuntimePageImpl.java:375)
    at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doDispatch(RuntimePageImpl.java:284)
    at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:113)
    at com.liferay.portal.layoutconfiguration.util.RuntimePageUtil.processTemplate(RuntimePageUtil.java:61)
    at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:506)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655)
    at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:302)
    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:405)
    at com.liferay.portal.action.LayoutAction.doExecute(LayoutAction.java:200)
    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:95)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:179)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:549)
    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:526)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
    at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:360)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:293)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
    at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:620)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:553)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:482)
    at com.liferay.portal.servlet.WidgetServlet.service(WidgetServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
    at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
    at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:267)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:620)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:553)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:482)
    at com.liferay.portal.servlet.I18nServlet.service(I18nServlet.java:114)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
    at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
    at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
    at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
    at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:57)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:420)
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)
    at java.lang.Thread.run(Thread.java:745)
  • If no user is authenticated in your request, then no user info object is available. You can check this with `request.getUserPrincipal()`. – Tobias Liefke Sep 18 '15 at 12:38
  • Well the user is authenticated (logged in) in Liferay. I'm confused about how else the user needs to be authenticated. I tested `request.getUserPrincipal()` and it also returned null. – JohnQuincyKerbal Sep 18 '15 at 12:48
  • Could you add the full stack trace - I would like to check who is creating the `PortletRequest`. – Tobias Liefke Sep 18 '15 at 15:22
  • I'm not sure which stacktrace you mean. The stack trace from our app shows a nullpointer error because it can't create a user bean because user info is not passed in from consumer. I added some new information I just found in `liferay.log` to the question. – JohnQuincyKerbal Sep 18 '15 at 15:39
  • I meant the stacktrace of the `NullPointerException`. And did you check if your user `adminscreen` exists in that portal instance? – Tobias Liefke Sep 18 '15 at 18:58
  • Yes I did. I created it in the producer Liferay instance. Consumers are still not propagating any user credentials that are available to my app however. Is it necessary to create a portal-ext.properties file and define some sort of authentication properties there? I have been reading other posts where modifying that file solved a lot of various wsrp issues. – JohnQuincyKerbal Sep 18 '15 at 19:01
  • Added stacktrace for nullpointer – JohnQuincyKerbal Sep 18 '15 at 19:19
  • Unfortunately I haven't used a WSRP portlet for a long time - so I'm not sure. But I would guess that the error is saying that the authorization itself is correct - just the user is missing. Is the log message from the producer Liferay as well? Did you check if the _instance_ (companyId) is correct. If you have more that one portal instance on your server it could happen that Liferay is using the wrong instance for authentication. – Tobias Liefke Sep 18 '15 at 19:19
  • Ok. My app checks the USER_INFO properties and creates a new user if one does not exist. So I think the problem is still stemming from the Liferay consumer not propagating authentication to the producer correctly. Like I said a local consumer (on same Liferay instance where the producer is) will send user info just fine and everything works. Only when a remote consumer accesses the portlet does it fail to pass in user parameters. Thanks for taking a look. – JohnQuincyKerbal Sep 18 '15 at 19:23
  • Unfortunately this revealed another problem. With this property enabled, Liferay accepts the user properties from the HTTP header but then tried to authenticate against its own user database table. Is there any way to consume a Liferay WSRP producer and have the portlet rendered on the consumer end using strictly the user information initally passed to the producer @TobiasLiefke? I don't want any authentication within Liferay. – JohnQuincyKerbal Sep 30 '15 at 20:23

1 Answers1

1

The issue was a property that I needed in portal-ext.properties (which goes in $LIFERAY_HOME btw).

auto.login.hooks=com.liferay.portal.security.auth.RequestHeaderAutoLogin

  • Unfortunately this revealed another problem. With this property enabled, Liferay accepts the user properties from the HTTP header but then tried to authenticate against its own user database table. Is there any way to consume a Liferay WSRP producer and have the portlet rendered on the consumer end using strictly the user information initally passed to the producer? I don't want any authentication within Liferay. – JohnQuincyKerbal Sep 30 '15 at 20:20