CAS installation

CAS is an application that implements a Single-Sign-On (SSO) mechanism. It is a good practise in production environments to install it and configure it so to have secure access to the Knowage server applications. CAS expects the use of the HTTPS protocol.

Deploy of the CAS application

Carry out the following steps:

  • shut down the server if running,

  • deploy CAS application,

  • for Tomcat: unzip the cas.war file inside the TOMCAT_HOME/webapps/cas

  • for JBoss: copy the cas.war file inside the JBOSS_HOME/standalone/deployments

  • edit /cas/WEB-INF/classes/ inserting the connection parameters for the metadata database of Knowage,as following

    Connection parameters for Knowage metadata db.
    1             spagobi.datasource.driver=<driver JDBC>
    2             spagobi.datasource.url=<URL JDBC>
    3             spagobi.datasource.user=<user_name>
    4             spagobi.datasource.pwd=<password> encript.password=true

For further details please refer to the official documents available on CAS website

HTTPS certificate

Since CAS application requires the use of the HTTPS protocol, the user must own an SSL certificate: it can be released a Certification Authority (CA) or it can be self-signed (it is recommended the use of the keytool utility - available in the JDK).

In case the certificate self-signed, it must be inserted in the CA repository of the JDK (usually such a repository is located in the JDK_HOME/jre/lib/security) or in an ad-hoc repository, called truststore, and conveniently configured in the application server in use. It is sufficient to set the two Java properties<truststore path> and<truststore password>

We suggest to refer to the Java documents for more details. In the following we will restrict on give some useful commands of the keytool utility if the user intends to install a self-signed certificate:

  • generate a copy of the public/private key-pair into a repository (keystore) called keystore.jks, as below:

keystore.jks creation.
1     $JAVA_HOME/bin/keytool -genkeypair -keystore keystore.jks -storepass {keystore password} -alias {certificate alias} -keyalg RSA -keysize 2048 -validity 5000 -dname CN={server name that hosts Knowage}, OU={organization unit}, O={organization name},L={locality name}, ST={state name}, C={country}
  • export a certificate in a cert.crt file, as suggested below:

Certificate export.
1     $JAVA_HOME/bin/keytool -export -alias {alias of the certificate} -file cert.crt -keystore keystore.jks
  • set the certificate inside the CA certificates of the JDK to make it accessible (the user will be asked the CA certificates password, the default one is changeit)

Importing the certificate into JDK CA repository.
1     $JAVA_HOME/bin/keytool -import -trustcacerts -alias {alias del certificato} -file cert.crt -keystore
2     $JAVA_HOME/jre/lib/security/cacerts

Configuration of the HTTPS protocol for Tomcat

To enable the HTTPS protocol it is necessary to operate according to these steps:

  • copy the keystore which contains the pair public/private keys (keystore.jks) inside the TOMCAT_HOME/conf;

  • edit the TOMCAT_HOME/conf/server.xml file, comment the HTTP connector on 8080 port and uncomment the HTTPS connector on 8443 port and configure it as below:

Export of the certificate.
 1             <Connector acceptCount="100"
 2                                     maxHttpHeaderSize="8192"
 3                                     clientAuth="false"
 4                                     debug="0"
 5                                     disableUploadTimeout="true"
 6                                     enableLookups="false"
 7                                     SSLEnabled="true"
 8                                     keystoreFile="conf/keystore.jks"
 9                                     keystorePass="<keystore password>"
10                                     maxSpareThreads="75"
11                                     maxThreads="150"
12                                     minSpareThreads="25"
13                                     port="8443"
14                                     scheme="https"
15                                     secure="true"
16                                     sslProtocol="TLS"
17             />

Knowage configuration

Once the CAS has been installed, it is necessary to modify the Knowage configuration. The user must edit some values of the SBI_CONFIG table using the administrator interface

Values of the SBI_CONFIG table to change.
 1             SPAGOBI_SSO.ACTIVE:
 2             set valueCheck to true
 5             set valueCheck to https://<URL of the CAS application>/cas
 8             set valueCheck to https://<URL of the Knowage server >:8443/knowage/proxyCallback
11             set valueCheck to https://<URL of the CAS application>/cas/logout

Then set the sso_class environment variable as below:

1             <Environment name="sso_class" type="java.lang.String" value=""/>

This variable is located:

  • Tomcat: in the TOMCAT_HOME/conf/server.xml

  • JBoss: in the JBOSS_HOME/ standalone/configuration/standalone.xml

Edit all knowage\WEB-INF\web.xml to activate CAS filters.

Setting the CAS filters for sso_class variable.
 1     <filter>
 2       <filter-name>CAS Authentication Filter</filter-name>
 3       <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
 4       <init-param>
 5        <param-name>casServerLoginUrl</param-name>
 6         <param-value>https://<nome del server CAS>/cas/login</param-value>
 7       </init-param>
 8       <init-param>
 9        <param-name>serverName</param-name>
10         <param-value><dominio di knowage, incluso il protocollo e la porta, se non standard></param-value>
11       </init-param>
12     </filter>
14     <filter>
15       <filter-name>CAS Validation Filter</filter-name>
16       <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
17       <init-param>
18             <param-name>casServerUrlPrefix</param-name>
19             <param-value>https://<nome del server CAS>/cas/</param-value>
20             </init-param>
21       <init-param>
22             <param-name>serverName</param-name>
23             <param-value><dominio di Knowage Server, incluso il protocollo e la porta, se non standard></param-value>
25       </init-param>
26       <init-param>
27             <param-name>proxyReceptorUrl</param-name>
28             <param-value>/proxyCallback</param-value>
29       </init-param>
31     [Nelle web application knowageXXXengine presente anche questo parametro:
33     <init-param> <param-name>proxyCallbackUrl</param-name>
34     <param-value>
35        <dominio di knowage Server, incluso il protocollo e la porta, se  non standard>/< knowageXXXengine>/proxyCallback </param-value>
36     </init-param>]
38     </filter>
40     <filter>
41       <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
42       <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFtilter</filter-class>
44     </filter>...
46     <filter-mapping>
47      <filter-name>CAS Authentication Filter</filter-name>
48      <url-pattern>/servlet/*</url-pattern>
49     </filter-mapping>
51     <filter-mapping>
52      <filter-name>CAS Validation Filter</filter-name>
53      <url-pattern>/servlet/*</url-pattern>
54     </filter-mapping>
55      <filter-mapping>
56      <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
57      <url-pattern>/servlet/*</url-pattern>
58     </filter-mapping>
60     [Nelle web application knowageXXXengine presente anche questo mapping:
61      <filter-mapping>
62       <filter-name>CAS Validation Filter</filter-name>
63       <url-pattern>/proxyCallback</url-pattern>
64       </filter-mapping>]

All web.xml files have CAS filters already configured, but they are commented. The user must uncomment them, looking for the strings START-CAS, END-CAS and adjust the URL as the code abow reports.