# elasticsearch.AuthenticationException: AuthenticationException(401, 'security\_exception', 'unable to authenticate user \[elastic\] for REST request \[/\]')

**URL:** <https://discuss.elastic.co/t/elasticsearch-authenticationexception-authenticationexception-401-security-exception-unable-to-authenticate-user-elastic-for-rest-request/310353>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [July 21, 2022, 11:38pm UTC](https://discuss.elastic.co/t/elasticsearch-authenticationexception-authenticationexception-401-security-exception-unable-to-authenticate-user-elastic-for-rest-request/310353 "2022-07-21T23:38:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pivotallifesciences](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@pivotallifesciences](https://discuss.elastic.co/u/pivotallifesciences)\
**Post date:** [July 21, 2022, 11:38pm UTC](https://discuss.elastic.co/t/elasticsearch-authenticationexception-authenticationexception-401-security-exception-unable-to-authenticate-user-elastic-for-rest-request/310353/1 "2022-07-21T23:38:52Z")

</div>

```auto
from query_patents.patents_query_tools import query_big_query
from elasticsearch import Elasticsearch, helpers
import configparser

config = configparser.ConfigParser()
config.read('tools/patent_scraper/google_patents/example.ini')

es = Elasticsearch(
    cloud_id=config['ELASTIC']['cloud_id'],
    basic_auth=(config['ELASTIC']['user'], config['ELASTIC']['password'])
)
es.info()

```

returns

```auto
elasticsearch.AuthenticationException: AuthenticationException(401, 'security_exception', 'unable to authenticate user [elastic] for REST request [/]')

```

I've used "elastic", I've used my user\_id, and I've used my email. I cannot think of something else. I copied and pasted the password from the login and I KNOW its correct.

Any idea how to fix this?

---

<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:** [August 18, 2022, 11:39pm UTC](https://discuss.elastic.co/t/elasticsearch-authenticationexception-authenticationexception-401-security-exception-unable-to-authenticate-user-elastic-for-rest-request/310353/2 "2022-08-18T23:39:40Z")

</div>

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