Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Appendix B Configuration Tasks : Cross-Origin Resource Sharing(CORS) Filter Properties

Cross-Origin Resource Sharing(CORS) Filter Properties
TIBCO API Exchange Gateway can be configured to add servlet filters to its Tomcat engine. You can enable CORS by adding one or more CORS filter to the Tomcat server instance that runs the HTTP channels.
To add a CORS filter, set the following properties either in ASG_HOME/bin/asg_core.cdd file or in the ASG_HOME/bin/asg_engine.tra file:
The CDD file can be edited in the following ways:
This section explains how to add the CORS filter properties in the asg_core.cdd file using a text editor. Do the following:
1.
Open the ASG_HOME/bin/asg_core.cdd file for editing in a text editor.
2.
be.http.filter.cors.class=org.apache.catalina.filters.CorsFilter
be.http.filter.cors.urlpattern.arbitraryUniqueName=urlPattern
where,
cors identifies an instance of the filter. It is a non-empty string which should contain no dot and no equals sign.
org.apache.catalina.filters.CorsFilter is the name of the class that implements the filter. For CORS, this must be org.apache.catalina.filters.CorsFilter
arbitraryUniqueName is a non-empty string chosen arbitrarily by the user.. This is used to make the name of the property unique.
arbitraryUniqueName cannot contain the equal sign.
arbitraryUniqueName cannot be shared by multiple properties that have the same be.http.filter.filterName.urlpattern. prefix.
urlPattern is the URL pattern that defines where the CORS filter is applied.
3.
Properties start with be.http.filter.filterName where filterName is the filter name.
filterName cannot contain a dot character "."
filterName is used both by TIBCO API Exchange Gateway and by Tomcat server to find all the declarations that apply to the same filter.
Adding URL patterns
To add additional url patterns, you can set following additional properties:
be.http.filter.cors.urlpattern.2
be.http.filter.cors.urlpattern.3
 
Example Value (URL Pattern)
be.http.filter.cors.urlpattern.2=/some/Url*
be.http.filter.cors.urlpattern.3=/anotherUrl
Add Filter Parameters
To add filter parameters, set the properties by following the structure: be.http.filter.cors.param.paraName=paramValue
where:
cors identifies an instance of the filter.
paraName is the parameter name. This should not contain no equals sign.
paramValue is the parameter value.
Example Value (Filter Parameters)
be.http.filter.cors.param.cors.allowed.origins=*
be.http.filter.cors.param.cors.allowed.methods=GET,POST,HEAD,OPTIONS,PUT
Refer to http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#CORS_Filter for a list of available parameter names and values.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved