Tuesday, December 23, 2008

OpenSSO and Liferay Integration - Life is not easier

Summary
Recently I tried to integrate Liferay 5.1.2 with OpenSSO Enterprise 8.0 but I was unlucky to complete it. The Liferay documentation explains a very simple steps to do the integration and is very easy to do. But when I run the Liferay server first time I got NullPointerException, then I figured out it was URL connection issue, I fixed it using a proxy server but then I got
ArrayIndexOutOfBoundsException, I am still debugging to find out the cause for this error.

How it happened?
I have installed Liferay 5.1.2 on Tomcat 6.0 and wanted to enable single sign on with liferay. The first one I tried was the AutoLogin and Authenticator plugin for liferay. It works cool, the only problem is that AutoLogin framework always expects single sign-on user password to be retrieved and pass to liferay server. I see a problem here because in my case password is not
retrievable in plain text. So if you have system that is having plain text password or you can get the password for the user from the system then everything works cool.

The next attempt was integrate with OpenSSO, the requirement for that look like very simple. first I have downloaded the OpenSSO server from Sun and installed it locally on my desktop. The liferay server is also running on the same desktop but in a different port.

I started both the servers [OpenSSO and Liferay - both are running on tomcat in different port] and the servers started cool. Then I login to Liferay and changed the Authentication settings to use OpenSSO. I have given the correct URL to the OpenSSO server and also created the administrator account "test@liferay.com" in OpenSSO. But when I try to access the Liferay Server I got a NullPointerException from the OpenSSOAutoLogin class in Lifray server. NullPointerException is the worst exception you like to see while debugging because it
will not give any clue why it happened. I guessed it could be because Liferay Server tries to make URL connection to OpenSSO server and that may be failing becuase my desktop is under a proxy server. So I have shutdown the liferay server and give the proxy server information as JVM arguments. I have edited the catalina.bat file and added the proxy server JVM arguments to the JAVA_OPTS variable. Then I restarted the server. The server started up and I accessed the Liferay home page and got a blank page on the screen and in the
log file "ArrayIndexOutOfBoundsException: 0" - OOPS!. I stuck and died.

Ok I have logged in to my Second Life now - and continuing to find a solution.

njoy
Sajith

No comments: