# No 'Access-Control-Allow-Origin' header is present

**URL:** <https://community.dreamfactory.com/t/no-access-control-allow-origin-header-is-present/1246>\
**Category:** REST API\
**Created:** [July 3, 2015, 6:23pm UTC](https://community.dreamfactory.com/t/no-access-control-allow-origin-header-is-present/1246 "2015-07-03T18:23:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![droldan](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@droldan](https://community.dreamfactory.com/u/droldan)\
**Post date:** [July 3, 2015, 6:23pm UTC](https://community.dreamfactory.com/t/no-access-control-allow-origin-header-is-present/1246/1 "2015-07-03T18:23:26Z")

</div>

I have created a service on dreamfactory and I’m trying to access it from my Kendo UI app. This is the portion of the code:

```auto
var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: "https://dsp-droldan01-49722.cloud.dreamfactory.com/rest/sql/detalle?app_name= **api_key**",
                
                type: "GET",
                                                           dataType: "json",
                                                           crossDomain : true,
                                                           beforeSend: function(req) {
                                                                          req.setRequestHeader("Access-Control-Allow-Origin:", "*"),
                                                                          req.setRequestHeader("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS"),
                                                                          req.setRequestHeader("Access-Control-Allow-Headers", "X-ACCESS_TOKEN, Access-Control-Allow-Origin, Authorization, Origin, x-requested-with, Content-Type, Content-Range, Content-Disposition, Content-Description")
                                                                        
                                                                          },
        }
    }

```

But I got an error:

GET [https://dsp-droldan01-49722.cloud.dreamfactory.com/rest/sql/detalle?app\_name=](https://dsp-droldan01-49722.cloud.dreamfactory.com/rest/sql/detalle?app_name=) **api\_key** b.ajaxTransport.send @ jquery.min.js:5b.extend.ajax @ jquery.min.js:5ct.extend.read @ kendo.all.min.js:11(anonymous function) @ kendo.all.min.js:11lt.extend.\_queueRequest @ kendo.all.min.js:11lt.extend.read @ kendo.all.min.js:11lt.extend.query @ kendo.all.min.js:11lt.extend.\_query @ kendo.all.min.js:11(anonymous function) @ kendo.all.min.js:11b.extend.Deferred @ jquery.min.js:3lt.extend.fetch @ kendo.all.min.js:11j.extend.init @ kendo.all.min.js:22(anonymous function) @ kendo.all.min.js:10b.extend.each @ jquery.min.js:3b.fn.b.each @ jquery.min.js:3yt.plugin.e.fn.(anonymous function) @ kendo.all.min.js:10(anonymous function) @ index.html:39b.Callbacks.c @ jquery.min.js:3b.Callbacks.p.fireWith @ jquery.min.js:3b.extend.ready @ jquery.min.js:3H @ jquery.min.js:3

## index.html:1 XMLHttpRequest cannot load [https://dsp-droldan01-49722.cloud.dreamfactory.com/rest/sql/detalle?app\_name=](https://dsp-droldan01-49722.cloud.dreamfactory.com/rest/sql/detalle?app_name=) **api\_key**. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘null’ is therefore not allowed access. The response had HTTP status code 403.

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [July 6, 2015, 3:25pm UTC](https://community.dreamfactory.com/t/no-access-control-allow-origin-header-is-present/1246/2 "2015-07-06T15:25:06Z")

</div>

How have you configured CORS?

---

<div class="post-metadata">

**Author:** ![droldan](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@droldan](https://community.dreamfactory.com/u/droldan)\
**Post date:** [July 6, 2015, 4:43pm UTC](https://community.dreamfactory.com/t/no-access-control-allow-origin-header-is-present/1246/3 "2015-07-06T16:43:03Z")

</div>

No, how can I do this on my project side? do you have a sample? I’m using JSON get call out type.

Thank you

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [July 8, 2015, 2:57pm UTC](https://community.dreamfactory.com/t/no-access-control-allow-origin-header-is-present/1246/4 "2015-07-08T14:57:23Z")

</div>

CORS is configured in your instance of DreamFactory, under Config. We provide a GUI component to configure it. If you absolutely must set this configuration from your app, then the app must authenticate as a full admin and POST the desired CORS configuration to `/rest/system/config`. You can see the proper format and possible configuration values in API Docs under `POST /system/config setConfig()`.

---

<div class="post-metadata">

**Author:** ![droldan](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@droldan](https://community.dreamfactory.com/u/droldan)\
**Post date:** [July 8, 2015, 4:40pm UTC](https://community.dreamfactory.com/t/no-access-control-allow-origin-header-is-present/1246/5 "2015-07-08T16:40:35Z")

</div>

I configured the CORS on my dreamfactory but I have another issue right now.

GET [https://dsp-droldan01-49722.cloud.dreamfactory.com/rest/sql/detalle?app\_name=](https://dsp-droldan01-49722.cloud.dreamfactory.com/rest/sql/detalle?app_name=) **api\_key** 403 (Forbidden)

This is my code:

```auto
  read: {
				url: "https://dsp-droldan01-49722.cloud.dreamfactory.com/rest/sql/detalle?app_name= **api_key**",
                type: "GET",
				dataType: "json",
				
				 beforeSend: function (xhr) {
   					xhr.withCredentials = true;
   					xhr.setRequestHeader('Authorization', 'Basic droldan01@hotmail.com:password');
				}
        }

```

I configured the access to guest and from a chrome browser I’m able to retrieve the JSON. Any ideas?
