# How to authenticate?

**URL:** <https://discuss.elastic.co/t/how-to-authenticate/155875>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [November 8, 2018, 11:37am UTC](https://discuss.elastic.co/t/how-to-authenticate/155875 "2018-11-08T11:37:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonaspreisler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonaspreisler/32/37421_2.png) [@jonaspreisler](https://discuss.elastic.co/u/jonaspreisler)\
**Post date:** [November 8, 2018, 11:37am UTC](https://discuss.elastic.co/t/how-to-authenticate/155875/1 "2018-11-08T11:37:55Z")

</div>

What's going on with my Elasticsearch in my app?

My app is RoR and deployed to Heroku.

I get this error:  
Faraday::ConnectionFailed (Failed to open TCP connection to localhost:9200 (Connection refused - connect(2) for "localhost" port 9200))

And I try to access my FOUNDELASTICSEARCH\_URL, which is [https://b71aa900c1f5dfc08438f9e72d1b4163.eu-west-1.aws.found.io/](https://b71aa900c1f5dfc08438f9e72d1b4163.eu-west-1.aws.found.io/)  
... I'm being asked for login.  
I then try to login with my Elasticsearch login info, but the login box just appears again.

Then I click 'Cancel' and met by the JSON which you see in the image in the link below. "unable to authenticate user for REST request [/]""

[[Album] Imgur: The magic of the Internet ![](https://i.imgur.com/XXLDXDm.jpg?fb "            
    

    Imgur: The magic of the Internet") ](https://imgur.com/a/pYmIaoC)

Also I saw in other topics that I have to visit [https://discuss.elastic.co/t/now-live-new-elastic-cloud-standard-support/84161](https://discuss.elastic.co/t/now-live-new-elastic-cloud-standard-support/84161) to find the answer.  
But when I visit that URL, I get this error: "  
Sorry, you don't have access to that topic!"

What's really going on here? 🙂

Thank you

- Jonas

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 9, 2018, 1:31am UTC](https://discuss.elastic.co/t/how-to-authenticate/155875/2 "2018-11-09T01:31:07Z")

</div>

If you are looking for Elastic Cloud support please see [https://www.elastic.co/cloud/as-a-service/support](https://www.elastic.co/cloud/as-a-service/support)

Please also see [https://www.elastic.co/guide/en/cloud/current/ec-security.html](https://www.elastic.co/guide/en/cloud/current/ec-security.html)

---

<div class="post-metadata">

**Author:** ![jonaspreisler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonaspreisler/32/37421_2.png) [@jonaspreisler](https://discuss.elastic.co/u/jonaspreisler)\
**Post date:** [November 9, 2018, 5:21am UTC](https://discuss.elastic.co/t/how-to-authenticate/155875/3 "2018-11-09T05:21:07Z")

</div>

Hi warklom

Thanks but I'm not looking for support for the cloud.

I'm looking for support regarding the Elasticsearch function in Ruby on Rails app deployed on Heroku.

Thank you

---

<div class="post-metadata">

**Author:** ![jonaspreisler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonaspreisler/32/37421_2.png) [@jonaspreisler](https://discuss.elastic.co/u/jonaspreisler)\
**Post date:** [November 9, 2018, 5:33am UTC](https://discuss.elastic.co/t/how-to-authenticate/155875/4 "2018-11-09T05:33:22Z")

</div>

I found the answer. Should run the following commands:

heroku addons:create bonsai

heroku config:set ELASTICSEARCH\_URL=`heroku config:get BONSAI_URL`

heroku run rake searchkick:reindex CLASS=PutYourClassHere

heroku run rake db:migrate

---

<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:** [December 7, 2018, 5:33am UTC](https://discuss.elastic.co/t/how-to-authenticate/155875/5 "2018-12-07T05:33:25Z")

</div>

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