Liferay and WebSphere SSO (simplistic)

Since Liferay is providing CAS (Central Authentication Service) support its possible to access Liferay through WebSphere SSO (LTPA tokens) login credentials.
So what to do?
I can not post all of our source code because of "some security" issues :-)
1. Edit (or portal-impl.jar//
1.1 Add/Edit the CAS configuration lines
## CAS

The bold lines say Liferay where to login or logout

2. Create Java-Classes for decrypting the WebSphere LTPA-Token
Have a look at these examples

and copy them to WEB-INF/classes/<class path> (or pack them into a jar-file)

3. Add AutoLogin-Classes (Step 2) to
auto.login.hooks=<class to decrypt ltpa token>,,...

4. Add was_logout.jsp to specify the cas-logout-path (see step 1)
Content (example):
<div style="text-align: center; color: rgb(153, 153, 153);"><%@ page import="java.util.*" %>
<%@ page import="com.liferay.portal.util.*;" %>
<form method="post" action="ibm_security_logout" name="logout">
<input name="logout" value="Logout" type="submit">
<input name="logoutExitPage" value="/" type="hidden">
<%-- auto-submitted by javascript --%>
<script type="text/javascript"><!-- logout.submit(); // --></script>


5. Create new Sign in portlet or edit the delivered sign in portlet
Content of view.jsp (example):
<% if (!themeDisplay.isSignedIn()) { %>

<%-- /* <form action="<portlet:renderURL windowState=">"><portlet:param name="struts_action" value="/mnet_sso_login/sso_forward"></portlet:param>" method="post" name="<portlet:namespace>fm"> */ --%>

<table class="login-table">

<td style="padding-bottom: 10px;">
<liferay-ui:message key="login">
<input name="j_username" class="form_input" type="text">
<td style="padding-bottom: 10px;">
<liferay-ui:message key="password">
<input name="j_password" class="form_input" type="password">

<input class="form_button" name="" type="submit">submit" value="<liferay-ui:message key="sign-in">">


<% } %>

6. Add Login-config to web.xml

Thats it

User logs in > LTPA-Token cookie is created by WebSphere >
Custom AutoLogin-Class is called > Custom AutoLogin-Class reads Cookies > Custom AutoLogin-Class decrypts LTAP-Token from Cookie > Custom AutoLogin-Class returns credentials array
credentials[0] = String.valueOf(user.getUserId());
credentials[1] = user.getPassword();
credentials[2] = boolean.TRUE.toString();
> Liferay accepts login