Enable auto login on kibana graph

Hello,
I am trying to skip login page of kibana graph which are embedded in my web console through iframe.

I Am trying to login through XMLHttpRequest but getting following error
Access to XMLHttpRequest at '*******' from origin 'http://localhost:3013' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

And also adding below line in http_tools.js
cors: { additionalHeaders: ['kbn-version','cookie'], origin: ['*'] }
And also added following lines in kibana.yml to enable cors login

server.cors: true
server.cors.origin: ['*']
server.cors.allow-credentials: 'true'

After doing above changes still getting the same error, Would appreciate any help to overcome this error .

Let me know if any other details is needed

Thanks

Have you tried enabling CORS setting in Kibana? In order to make requests across domains inside a browser, you'll need to enable CORS on the Kibana server. Unfortunately, this is not a documented configuration option, but it is supported.

Add server.cors: true to your kibana.yml in the Cloud dashboard. This should add the Access-Control-Allow-Origin: * header to all responses from Kibana. Note that this enables any webpage to access your Kibana API, though of course they'll still need valid credentials if you're using Security.

Hope his helps,
Thanks
Rashmi