Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Unable to authenticate to Livelink using siteminder cookie from LAPI
Robert Clavelle
We have plumtree portal where we have one of our portlet which access our remote J2EE server having LAPI installed and has some of the Java classes which uses LAPI to make calls to Livelink. Plumtree portal sends SMSESSION cookies to our J2EE server which I am trying to use to connect to LiveLink server. We have already configured Siteminder to send these cookies to our plumtree portal.( Means siteminder cookie is working and logging in the users to the portal) I am trying the following code which is retrieving SMSESSION cookie from the request object. String siteminderCredentials = ""; Enumeration heads = request.getHeaderNames(); while(heads.hasMoreElements()) { String head = heads.nextElement().toString(); System.out.println(head +" -- " +request.getHeader(head) ); if("HTTP_COOKIE".equals(head.toUpperCase())) { siteminderCredentials = request.getHeader(head); System.out.println(siteminderCredentials); //.substring(10) // break; } } and then I am using following LAPI code to get the llivelink session but no success //Create a new Livelink Session LLSession session = new LLSession ("LLServer", 2099,siteminderCredentials, null); Does anyone has done this before?
Find more posts tagged with
Comments
Rory_Lampert_(xomaca01admin_-_(deleted))
From the description......you are using LAPI over HTTP. In this case you will have to set the config parameter in LLSession object with login credentials. Also the web server has to be set for Basic Auth. I know basic auth and LAPI over HTTP works....but I am not sure about siteminder....even if siteminder is set to do basic auth. I had tried some time back and could not get it to work (though i must admit i did not spend a lot of time on this). Let me know if you are able to get LAPI to work with siteminder.Coming to the portlet....I assume that you are trying to ensure that user has a siteminder session....which means he has already logged in and then processing the java application on the J2EE server to render a jsp or an HTML that is built through a servlet.This may also be achieved by looking at the REMOTE_USER HTTP header that is set. REMOTE_USER will be set only if a user is logged in.We have implemented such an approach and plumtree portal (now BEA) does indeed forward all the HTTP headers to the remote server (which includes REMOTE_USER).M2C.HTH.Vinit.
Adam_Myatt
Finally got it to work. The confusion lies in the terminology around the Livelink Cookie that can be passed to the LLSession constructor. This is only a Livelink cookie, and has nothing to do with a browser session ID or the Siteminder cookie.If the HTTP header protocol that LAPI uses they do not pass an HTTP header named "cookie: " which is required for Siteminder to correctly know that you have already performed an SSO authentication.Scenario. You have a Java-based web app running in a J2EE server (say Tomcat or Weblogic). You request a page in a browser, the Siteminder "watching" the site intercepts the requests, sees you have not authenticated, and displays the SSO login page. You log in and authenticate, and Siteminder redirects you back to your web app. In that web app to auth to Livelink via HTTP/HTTPS where your Livelink instances is also "watched" by Siteminder you need to do the following. RRetrieve the Siteminder Session cookie (typically called SMSESSION) from the cookies using JSP like : String SMSESSION = "";Cookie[] cookies = request.getCookies();for(int i=0; i<cookies.length; i++){ String strCookieName = cookies[i].getName(); if("SMSESSION".equals(strCookieName.toUpperCase())) { SMSESSION = cookies[i].getValue(); }}Then pass that value to LAPI, but here's the PROBLEM . There is no way to do so with LAPI as is. You need to modify the Source of LLConnect.sendInitialHeader() method to append the text "Cookie: SMSESSION=VALUE" where `value? should be a parameter you pass in that is the actual value of the SMSESSION cookie retrieved through your web application and passed down through LAPI (modifyLLSession.getConfigValues to accept an additional value inside the LLValue object that is passed in. Then add an IF clause to retrieve that value and set an internal class member to that value. Append that class member to the "Cookie: SMSESSION=" text above in place of the VALUE marker. This is the ONLY way I have been able to get LAPI to work via HTTP/HTTPS where Livelink is behind Siteminder.