Enabling CORS access

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsEnabling CORS access
(Created page with "### Tutorial To enable CORS access in DreamFactory 2.0, login to the admin console and click on the 'Config' tab. Then click 'CORS' from the left menu. To create a new CORS...")
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
### Tutorial
+
To enable CORS access in DreamFactory, log in to the admin console and click on the 'Config' tab. Then click 'CORS'  
 
+
To enable CORS access in DreamFactory 2.0, login to the admin console and click on the 'Config' tab. Then click 'CORS'  
+
 
from the left menu. To create a new CORS access rule, click on the plus button ([+]) next to '-- Select CORS Entry --'  
 
from the left menu. To create a new CORS access rule, click on the plus button ([+]) next to '-- Select CORS Entry --'  
 
drop down box. After that enter your allowed Origin, Paths, Headers, Max Age (browser caching CORS access), and Methods.  
 
drop down box. After that enter your allowed Origin, Paths, Headers, Max Age (browser caching CORS access), and Methods.  
Line 8: Line 6:
  
 
[[File:Tutorial enable cors.png|800px]]
 
[[File:Tutorial enable cors.png|800px]]
 +
 +
=== FAQS ===
 +
 +
<code>Access to XMLHttpRequest at 'https://example.com/api/v2/' from origin 'http://test.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. </code>
 +
 +
* Check that there are no spaces  in your origins field.

Latest revision as of 17:51, 2 January 2019

To enable CORS access in DreamFactory, log in to the admin console and click on the 'Config' tab. Then click 'CORS' from the left menu. To create a new CORS access rule, click on the plus button ([+]) next to '-- Select CORS Entry --' drop down box. After that enter your allowed Origin, Paths, Headers, Max Age (browser caching CORS access), and Methods. The Paths field lets you control access to specific API paths. For example, if you only want to expose a database service named 'my_db' over CORS, you can put 'api/v2/my_db/*' in the Paths.

Tutorial enable cors.png

FAQS

Access to XMLHttpRequest at 'https://example.com/api/v2/' from origin 'http://test.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

  • Check that there are no spaces in your origins field.