My goal is to skip login page in Kibana.
With an HTTP request, I would to login in Kibana using the REST API /internal/security/login.
The request is come from my Angular application and to bypass CORS and multi-origin, I edited the http_tools.js
adding this line
cors: { additionalHeaders: ['kbn-version','kbn-xsrf','cookie'], origin: ['*'], credentials: true },
instead of
cors: config.cors,
This is the code of the Angular request:
fetch(environment.URL_login, {
method: 'POST', body: body,
credentials: 'include', headers: {'Content-Type': 'application/json',
'kbn-version': '7.6.2'},
}).then(res => {
console.log(res);
window.open(environment.URL, "_blank");
The post call returns me status 204 and a Response containing empty headers.
If I click on the Network tab of the Inspector Chrome, I see the cookie created in Cookies section.
How can I get the cookie, that is dynamically created by kibana, within the response that I obtain from the http post?