+

Search Tips   |   Advanced Search

Use a WebSphere Application Server API to achieve downstream web single sign-on with an LtpaToken2 cookie

We can programmatically perform downstream Single Sign On (SSO) web propagation of a LTPA cookie without the need for an application to store and send user credentials. WebSphere Application Server provides API support to propagate an LtpaToken2 cookie to downstream web single sign-on applications. Web applications running in mid-tier WebSphere servers might need to propagate LtpaToken2 cookies on downstream web invocations. In WAS v9, a new API is provided for application developers to programmatically perform downstream SSO without the need for an application to store and send user credentials.

This function is a public API in package...

...and is defined as follows...

The following is an example of how we can use the new WSSecurityHelper API:

Deprecated feature: The getLTPACookieFromSSOToken() method from the WSSecurityHelper class is deprecated. Use the functionality provided by the getSSOCookieFromSSOToken() method from the WebSecurityHelper class.depfeat

Subsequently, the LTPA cookie can be set on an HTTP request header. In this case, the value of the cookie header is the string:

For example, if we use org.apache.commons.httpclient.HttpMethod to build the HTTP request, the LTPA cookie can be set as follows:

We should only send LTPA cookies over SSL connections.

We must check whether the LTPA cookie that is returned from calling WSSecurityHelper.getLTPACookieFromSSOToken() in the previous example is not null before we issue any getter methods. Also, to successfully retrieve a LTPA cookie object, and to ensure an SSO token on the thread of execution, make sure that the user has established a successful authentication with the mid-tier server.

WebSphere Application Server does not ship supporting jars for HTTP programming, such as the Apache httpclient. Provide our own supporting functions for HTTP programming.


Related:

  • Single sign-on for authentication using LTPA cookies
  • Single sign-on for authentication