CORS Error in Pentaho 7.1 CE -
i trying integrate pentaho 7.1 ce version angular application , there have access pentaho context. authentication purposes here, using cookies-based api , passing parameter. during this, getting following error:
xmlhttprequest cannot load http://localhost:8083/pentaho/j_spring_security_check. redirect 'http://localhost:8083/pentaho/j_spring_security_check' 'http://localhost:8083/pentaho/home;jsessionid=e0b8ffafe57edec09db8229457faa7b4' has been blocked cors policy: no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost:4200' therefore not allowed access.
i have enable cors in pentaho , modified web.xml
file located atpentaho-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 suggest me missing here? idea how can solve problem?
i faced same issue when tried create webapi , consume angular2 web app. fixed installing nuget https://www.nuget.org/packages/microsoft.aspnet.webapi.cors in webapi solution. there’s how-to-use explanation of nuget worked fine me.
Comments
Post a Comment