CORS and Camunda REST

4 387 просмотров
Перейти к первому непрочитанному сообщению

Eldar Aliyev

не прочитано,
27 дек. 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

не прочитано,
30 дек. 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

не прочитано,
8 янв. 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

не прочитано,
9 янв. 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

не прочитано,
24 сент. 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.

Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений