Cross-Origin Resource Sharing (CORS) Filter Settings in CA Service Desk Manager (CA SDM)
search cancel

Cross-Origin Resource Sharing (CORS) Filter Settings in CA Service Desk Manager (CA SDM)

book

Article ID: 31714

calendar_today

Updated On:

Products

CA Service Desk Manager CA Service Management - Service Desk Manager

Issue/Introduction

CORS Filter is the first universal solution for fitting Cross-Origin Resource Sharing (CORS) support to Java web applications. CORS is a recent W3C effort to introduce a standard mechanism for enabling cross-domain requests from web browsers to servers that wish to handle them.

Environment

CA Service Desk Manager 12.9 and Higher

Resolution

The following instructions outline how to configure Apache Tomcat 7.0.55 for use with CA Service Desk Manager to add CORS Support. 

Note: Make sure the Tomcat is upgraded to at least version 7.0.41

  1. Take the backup of WEB.XML from NX_ROOT\bopcfg\www\CATALINA_BASE\webapps\CAisd\WEB-INF.

    Make sure the backup of the web.xml is in another directory entirely.  Please do not make a copy of the web.xml file in the same place as the main file.
  1. Open WEB.XML from NX_ROOT\bopcfg\www\CATALINA_BASE\webapps\CAisd\WEB-INF with a text editor
  1. Look for the statement
 <!-- Add filter here -->

 

  1. Copy and paste the following configuration
 <!-- Cross-origin support for Attachments Servlet -->
<filter>
<filter-name>CORS</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.supportedMethods</param-name>
<param-value>POST, GET, OPTIONS</param-value>
 </init-param>

<init-param>
<param-name>cors.allowOrigin</param-name>
<param-value>*</param-value>
 </init-param>

 </filter>
  1. Look for the statement
 <!-- Add filter-mapping here -->

 

  1. Copy and paste the following configuration
 <!-- Cross-origin support for Attachments Servlet -->

<filter-mapping>
<filter-name>CORS</filter-name>
<servlet-name>UploadServlet</servlet-name>
 </filter-mapping>
  1. When completed, the added content should look like below
 <!-- Add filter here -->

<!-- Cross-origin support for Attachments Servlet -->
<filter>
<filter-name>CORS</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.supportedMethods</param-name>
<param-value>POST, GET, OPTIONS</param-value>
 </init-param>

<init-param>
<param-name>cors.allowOrigin</param-name>
<param-value>*</param-value>
 </init-param>

 </filter>

<!-- Add filter-mapping here -->
<!-- Cross-origin support for Attachments Servlet -->
<filter-mapping>
<filter-name>CORS</filter-name>
<servlet-name>UploadServlet</servlet-name>
 </filter-mapping>

  1. Download the java-properties-utils-1.7.1.jar file attached to this KB article
  2. Add the downloaded file to the NX_Root/bopcfg/www/CATALINA_BASE/shared/lib folder

 

  1. Save the modified WEB.XML file and restart the Tomcat process.

Additional Information

Please make sure you are modifying the correct files based on your needs.  SDM carries multiple components that each contain a Tomcat element.

CATALINA_BASE:  This is the baseline Tomcat component (Default Tomcat Port 8080)
CATALINA_BASE_FS:  This is the Tomcat component used in Federated Search (Default Tomcat Port 8040)
CATALINA_BASE_REST:  This is the Tomcat component used in REST Web Services (Default Tomcat Port 8050)
CATALINA_BASE_SA:  This is the Tomcat component used for Support Automation (Default Tomcat Port 8070)
CATALINA_BASE_VIZ:  This is the Tomcat component for Visualizer (Default Tomcat Port 9080)

Attachments

java-property-utils-1.7.1.jar get_app