Skip to Content
Author's profile photo Dan Cristian MARINESCU

How to add SSO authentication to BI 4.1 using Java filter

One of the frequent questions from our customers is how to create a customized SSO enterprise authentication for BI LaunchPad and for Open Document queries. One of the most easiest way is to use servlet filter in Tomcat. You can find below the steps needed to create, develop and deploy the SSO filter:

Create a new project in Eclipse:


Enter the project name and pick the Tomcat runtime (same as your BI web server):


Add a new class to your project


Type the package name, class name and click on Add button


Type filter and choose the interface javax.servlet.Filter


Click on finish


Copy the SDK libraries from the folder below to a project folder:


Go to configure build path of your project and add the SDK files, using Add External JARs button:


Copy and paste the code below into the file:



import javax.servlet.Filter;

import javax.servlet.FilterChain;

import javax.servlet.FilterConfig;

import javax.servlet.ServletException;

import javax.servlet.ServletRequest;

import javax.servlet.ServletResponse;

import com.crystaldecisions.sdk.exception.SDKException;

import com.crystaldecisions.sdk.framework.CrystalEnterprise;

import com.crystaldecisions.sdk.framework.IEnterpriseSession;



import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

public class SSOFilter implements Filter {

private static FilterConfig filterConfig = null;

public SSOFilter() {}


public void destroy() {

// TODO Auto-generated method stub



public void doFilter(ServletRequest request, ServletResponse response,

FilterChain chain) throws IOException, ServletException {

// TODO Auto-generated method stub

HttpServletRequest servletRequest = (HttpServletRequest)request;

HttpServletResponse servletResponse = (HttpServletResponse)response;

String userName = “test”;

String password = “password”;

        String requestURL = servletRequest.getRequestURL().toString();



if (requestURL.contains(“openDocument.jsp”) && servletRequest.getParameter(“token”)==null) {


servletRequest.getParameter(“sIDType”)+”&token=”+createEncodedToken(userName, password));

} else if (requestURL.contains(“BOE/BI”) && !(requestURL.contains(“start”))) {

((HttpServletResponse) response).sendRedirect(requestURL+”/logon/”+createEncodedToken(userName, password));

} else {

chain.doFilter(request, response);


} catch (SDKException e) {

chain.doFilter(request, response);

} catch (UnsupportedEncodingException e) {

chain.doFilter(request, response);




public void init(FilterConfig config) throws ServletException {

// TODO Auto-generated method stub



public String createEncodedToken(String userName, String password) throws SDKException, UnsupportedEncodingException {

IEnterpriseSession enterpriseSession = CrystalEnterprise.getSessionMgr().logon(userName, password, “localhost”, “secEnterprise”);

return URLEncoder.encode(enterpriseSession.getLogonTokenMgr().createWCAToken(“”, 750, 9999), “UTF-8”);


private void setFilterConfig(FilterConfig config)


filterConfig = config;


private static FilterConfig getFilterConfig()


return filterConfig;



It should look like the following:


Export the project as JAR file:


Select only source files, like below:


Copy the jar file into the following folder:


Modify the file web.xml from the folder to add the new SSO filter:


Add the class name and the filter and filter-mapping xml nodes as following:


Restart the tomcat server and the filter should be running!

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.