Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I pass authentication header with elastic search connection request when using http basic auth for elasticsearch. #190

Closed
mayank-singh opened this issue Jun 8, 2015 · 8 comments

Comments

@mayank-singh
Copy link

How can I pass authentication header with elastic search connection request when using http basic auth for elasticsearch.

@pyromaniac
Copy link
Contributor

Good question actually. There is no way currently, this need to be patched in chewy

@pyromaniac
Copy link
Contributor

Have you find a way?

@timoshenkoav
Copy link

you can use this syntax to set http user/password in chewy.yml

development:
  host: 'http://<username>:<password>@<host>'

@mayank-singh
Copy link
Author

host: 'localhost:9200'
prefix: 'dev'
user: 'user'
password: 'pass'

I used the above config @pyromaniac

@Ryan-Berry
Copy link

Is there now a set way to do this? I've tried both solutions offered by @mayank-singh and @timoshenkoav but neither are working for me. Security was just applied to my cluster using Elastic Shield.

@pyromaniac
Copy link
Contributor

pyromaniac commented Nov 30, 2016

As far as I get, you need to setup basic http auth, this means that you need to send an auth request with the transport, or send your credentials with every request. Anyway, seems like you have to customize the transport. So, you can try this: https://github.com/toptal/chewy/blob/master/lib/chewy.rb#L137

@davidrf
Copy link

davidrf commented Jan 30, 2017

Given that you're able to authenticate with http://username:password@localhost:9200 using cURL requests, then you can achieve the same with chewy by updating your chewy.yml like so:

production:
  host: "localhost"
  scheme: "http"
  port: "9200"
  user: "username"
  password: "password"

@brauliobo
Copy link

this should be on the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants