# CORS error when attempting to access Kibana/ElasticSearch URL

**URL:** <https://discuss.elastic.co/t/cors-error-when-attempting-to-access-kibana-elasticsearch-url/174201>\
**Category:** Elasticsearch\
**Created:** [March 27, 2019, 8:29pm UTC](https://discuss.elastic.co/t/cors-error-when-attempting-to-access-kibana-elasticsearch-url/174201 "2019-03-27T20:29:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kehinde\_Owens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kehinde_owens/32/42259_2.png) [@Kehinde\_Owens](https://discuss.elastic.co/u/Kehinde_Owens)\
**Post date:** [March 27, 2019, 8:29pm UTC](https://discuss.elastic.co/t/cors-error-when-attempting-to-access-kibana-elasticsearch-url/174201/1 "2019-03-27T20:29:17Z")

</div>

Hello,

I'm dealing with an issue in which i'm trying to make a call to my Kibana URL from my localhost and it's being blocked. The error is

```auto
Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

```

My settings in my ElasticSearch nodes are:

```auto
http.cors.enabled: true
http.cors.allow-origin: "http://localhost:4200"
http.cors.allow-credentials: true
http.cors.allow-headers: "Authorization, kbn-xsrf, Content-Type, Content-Length, X-Requested-With"

```

And in my Kibana instance:

```auto
server.cors: true
server.cors.origin: "*"

```

The code that I am attempting to pass through is:

```auto
const headers = new HttpHeaders({
       'Content-Type': 'application/json',
       'kbn-xsrf': '6.5.4' });
    const options = { headers: headers };

    this.http.post(
      'https://investc-policydashboard.drlteam.net/api/security/v1/login',
      { username: 'user', password: 'password' },
      options
    ).map(res => res).subscribe(() => console.log('Sent request to Kibana to log in.'));

```

It may be important to note that i'm configuring this on Linux Centos and the Kibana instance and my 3 ElasticSearch instances have separate nodes.. equaling to 4 virtual machines. They are behind a proxy which to be specific is the Azure Application Gateway.

Any help would be appreciated. Thank you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 24, 2019, 8:31pm UTC](https://discuss.elastic.co/t/cors-error-when-attempting-to-access-kibana-elasticsearch-url/174201/2 "2019-04-24T20:31:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
