Unable to perform login on kibana throught browser javascript api call

It looks like we disallow this option in Elastic Cloud. Reach out to Cloud Support, they may be able to enable this setting for you.

If not, you will need to set up a proxy server (eg. nginx) in front of your Kibana server to add these headers. Though before doing that, you may want to explore other options. What is it that you're trying to develop?