API call - CORS error for Jaspersoft
search cancel

API call - CORS error for Jaspersoft

book

Article ID: 263385

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Desk Manager

Issue/Introduction

We are trying to call Jasper API for scheduling report from service desk. We are having problem with CORS:

Environment

Release: 17.3 or higher
Component:  CA Service Desk Manager

Resolution

add this to the \webapps\jasperserver-pro\WEB-INF\web.xml file and restart Jaspersoft
           <filter-name>CORS</filter-name>
           <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
           <init-param>
                <param-name>cors.allowed.methods</param-name>
                <param-value>GET,PUT,OPTIONS,POST,HEAD</param-value>
           </init-param>
           <init-param>
                <param-name>cors.allowed.origins</param-name>
                <param-value>*</param-value>
           </init-param>
           <init-param>
                <param-name>cors.allowed.headers</param-name>
                <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,if-modified-since,cache-control,Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
           </init-param>
           <init-param>
                <param-name>cors.exposed.headers</param-name>
                <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
           </init-param> 
                       
     </filter>
     
    <filter-mapping>
        <filter-name>CORS</filter-name>
        <url-pattern> /* </url-pattern>
    </filter-mapping>