CORS Error in Pentaho 7.1 CE

148 views
Skip to first unread message

Sumit Bansal

unread,
Sep 10, 2017, 3:08:27 PM9/10/17
to Pentaho Community
I am trying to integrate Pentaho 7.1 CE version with Angular application and there i have to access the pentaho context.For Authentication purpose here i am using cookies based api and passing the parameter .During this i am getting the below mentioned error:


XMLHttpRequest cannot load http://localhost:8083/pentaho/j_spring_security_check. Redirect from 'http://localhost:8083/pentaho/j_spring_security_check' to 'http://localhost:8083/pentaho/Home;jsessionid=E0B8FFAFE57EDEC09DB8229457FAA7B4' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.

I have already enable the CORS in pentaho and modified web.xml file located at pentaho-server\tomcat\conf:

<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
  <init-param>
    <param-name>cors.allowed.origins</param-name>
    <param-value>*</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.methods</param-name>
    <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.headers</param-name>
    <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Allow-Origin,Access-Control-Request-Method,Access-Control-Request-Headers</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>
  <init-param>
    <param-name>cors.support.credentials</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>cors.preflight.maxage</param-name>
    <param-value>10</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

Can any one success me what i am missing here ..Any idea how i can solved this problem:

Reply all
Reply to author
Forward
0 new messages