Monday, November 21, 2011

Oracle Portal and WSRP Producer

If you are developing WSRP portlet provider with JDeveloper/Weblogic, and going to implement some security, you may have some issue like we had.
Or you have not if you wouldn't  use Oracle Portal.
The simplest thing you should  get user name and make some decision or just greet the user. 
So the standard way is:
 .....
PortletRenderRequest portletRequest = (PortletRenderRequest)
                            request.getAttribute("oracle.portal.PortletRenderRequest");
String name = portletRequest.getRemoteUser();
......
Most likely that name will be null. We wasted some time, trying to find the solution. Thanks Google, The Wonderful and Manoj we find it. Here you are:
Add this option to your portlet.xml and you will get user name from Oracle Portal or Webcenter application.
...
<container-runtime-option>
     <name>com.oracle.portlet.useWsrpUserContextForUserAuthenticationInfo</name> 
     <value>true</value>
</container-runtime-option>
.....

P.S. It definitively works with Oracle Portal  11.1.1.4 and WebCenter 11.1.1.5

Post a Comment