# Login api call fails

**URL:** <https://discuss.elastic.co/t/login-api-call-fails/82171>\
**Category:** Kibana\
**Created:** [April 12, 2017, 1:28pm UTC](https://discuss.elastic.co/t/login-api-call-fails/82171 "2017-04-12T13:28:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.S.S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m.s.s/32/134307_2.png) [@M.S.S](https://discuss.elastic.co/u/M.S.S)\
**Post date:** [April 12, 2017, 1:28pm UTC](https://discuss.elastic.co/t/login-api-call-fails/82171/1 "2017-04-12T13:28:53Z")

</div>

I will use Kibana inside iframe in my web app. For this purpose i need to call login api "/api/security/v1/login".  
In postman i could call the api, success response came. But when i call the api via javascript&ajax, browser(chrome) sends preflight request before the real POST request and this preflight request fails : "Response for preflight has invalid HTTP status code 404"  
What should i do for solving this problem?  
Thanks.

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [April 12, 2017, 2:01pm UTC](https://discuss.elastic.co/t/login-api-call-fails/82171/2 "2017-04-12T14:01:08Z")

</div>

> [@M.Selman\_Sezgin](#):
>
> What should i do for solving this problem?

Hi

What is the version of Kibana you are using ? Also if its \>5.0, and if x-pack is installed, can you enable audit logging for security and see the logs. More information would be helpful.

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![M.S.S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m.s.s/32/134307_2.png) [@M.S.S](https://discuss.elastic.co/u/M.S.S)\
**Post date:** [April 12, 2017, 2:30pm UTC](https://discuss.elastic.co/t/login-api-call-fails/82171/3 "2017-04-12T14:30:36Z")

</div>

Hi,

Version is 5.3.0  
Kibana and Elastic search running on elastic cloud. Every settings are on default.

I tried to add "shield.audit.enabled: true" to yml file using ./configuration/User Settings editor in cloud page. But it seems it is not allowed configuration type.

Supported configuration listed at this link:  
[https://www.elastic.co/guide/en/cloud/current/cluster-config.html#user-settings](https://www.elastic.co/guide/en/cloud/current/cluster-config.html#user-settings)

Thanks

---

<div class="post-metadata">

**Author:** ![M.S.S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m.s.s/32/134307_2.png) [@M.S.S](https://discuss.elastic.co/u/M.S.S)\
**Post date:** [April 13, 2017, 6:03am UTC](https://discuss.elastic.co/t/login-api-call-fails/82171/4 "2017-04-13T06:03:52Z")

</div>

**This is how i call login:** This code generated by postman, where i can call login succesfully.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/b/e/bee84b78800d1aac5daa47ccfedf6e65dfe8bed5.png)  
**Response to this call :**  
{"statusCode":404,"error":"Not Found"}  
Response for preflight has invalid HTTP status code 404

**Postman response:**

 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d9652d50af7951d8583e49d292b394e4c3c90074.png)

---

<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:** [May 11, 2017, 6:04am UTC](https://discuss.elastic.co/t/login-api-call-fails/82171/5 "2017-05-11T06:04:07Z")

</div>

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