CORS and Camunda REST

4.387 de afișări
Accesați primul mesaj necitit

Eldar Aliyev

necitită,
27 dec. 2013, 07:34:0627.12.2013
– camunda-...@googlegroups.com
How to turn on Cross-Origin Resource Sharing (CORS) response headers to Camunda REST engine in default distribution packet (with tomcat 7.0) to be able to make ajax requests from standalone javascript application?

Daniel Meyer

necitită,
30 dec. 2013, 04:10:1430.12.2013
– camunda-...@googlegroups.com
Hi Eldar,

Maybe you can implement this as custom Filter in a comparable way to which we implement the CacheControl filter:

You could than package your filter as a JAR file, add it to the WEB-INF/lib Folder of the engine-rest/ application and activate it in WEB-INF/web.xml File

WDYT?

Cheers,
Daniel Meyer

Eldar Aliyev

necitită,
8 ian. 2014, 01:01:0708.01.2014
– camunda-...@googlegroups.com
Hi, Daniel

Thank you for your responce. And sorry for late answer and newbie question :) But lastly I found out a working solution in standard Tomcat 7 distribution. There is a CORS filter and the point is that it's declaration must prepend any other filters in engine-rest web.xml config file.
I used the following options in my config and it seems working well enough:
    <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,DELETE</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,Authorization</param-value>    
       
</init-param>    
       
<init-param>    
           
<param-name>cors.exposed.headers</param-name>    
           
<param-value>Access-Control-Allow-Origin</param-value>      
       
</init-param>    
   
</filter>
   
<filter-mapping>
     
<filter-name>CorsFilter</filter-name>
     
<url-pattern>/*</url-pattern>
   
</filter-mapping>



Regards,
Eldar A.

понедельник, 30 декабря 2013 г., 14:10:14 UTC+5 пользователь Daniel Meyer написал:

Daniel Meyer

necitită,
9 ian. 2014, 05:32:5909.01.2014
– camunda-...@googlegroups.com
Hi Eldar,

There are no newbee questions :) Thanks for posting your solution here,
since this is quite a common usecase, I think it will be helpful to
other people as well!

Thanks,
Daniel Meyer

shiv...@gmail.com

necitită,
24 sept. 2015, 12:42:0424.09.2015
– camunda BPM users
Hi,

How to turn on Cross-Origin Resource Sharing (CORS) response headers to Camunda REST engine in default distribution packet (with jboss-as-7.2.0.Final) to be able to make ajax requests from standalone javascript application?

The above post is really helpful, but I need to enable CORS in jboss? We are not having an option of enabling filter in jboss configuration.

Răspundeți tuturor
Răspundeți autorului
Redirecționați
0 mesaje noi