I am trying to set up security for KIbana in docker setup and facing some issues

Let me elaborate.
1.The set up is inside the Docker container.
2.We have this architecture filebeat->logstash>elasticsearch->Kibana
3.I have enabled security in kibana,set up the password authentication,given the username and password in elasticsearch.yml
4.I am getting the login page for kibana
5.Issue is that once I enter the elastic credentials it does not take login to kibana page,insated it comes back to the credential page again.

The credentials are correct,whenever I try to enter a wrong credential, it throws errors ,so confirming that it is the correct credential which I am entering.
I have done the configurations in windows and it is successful,however I am having issue in docker.

The version which I am using is compatible according to the metrix, I am using 7.9 kibana and elasticsearch
Logs shows authentication to elasticsearch failed.

Please advise.

Go to Source
Author: Sneha