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

Unclear how to get past Basic Authentication #87

Open
provtemp opened this issue Mar 10, 2022 · 1 comment
Open

Unclear how to get past Basic Authentication #87

provtemp opened this issue Mar 10, 2022 · 1 comment

Comments

@provtemp
Copy link

It is not clear to me how to query an endpoint that uses HTTP Basic Authentication. I tried

    engine = create_engine(
        "elasticsearch+https://.../",
        connect_args={"password": credentials.password, "user": credentials.login},
    )

but that neither puts an Authorization header in the request, nor does it automatically retry with one upon receiving the HTTP/1.1 401 Unauthorized response, using

elastic-transport==8.0.1
elasticsearch==8.0.1
elasticsearch-dbapi==0.2.2
SQLAlchemy==1.4.32

There should at least be an example in the documentation.

@provtemp
Copy link
Author

response = self.es.transport.perform_request("POST", path, body=payload)

Removing ^ .transport seems to work.

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

1 participant