Conjur-api-python3 - Trouble authenticating

I’m trying to retrieve secrets in Python 3 and am using conjur-api-python3

Authentication works when using the conjur-cli tool included with the pip install, but doing the same thing from within Python results in an error.

[root@lncd906 ~]# conjur-cli list | head -4 | sed ‘/REDACTED/s//REDACTED/’
[
“REDACTED:policy:root”,
“REDACTED:policy:conjur/cluster/conjur”,
“REDACTED:layer:conjur/cluster/conjur”,
[root@lncd906 ~]# python3
Python 3.6.8 (default, Jun 11 2019, 15:15:01)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

from conjur import Client
c = Client()
c.list()
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python3.6/site-packages/conjur/client.py”, line 115, in list
return self._api.list_resources()
File “/usr/local/lib/python3.6/site-packages/conjur/api.py”, line 147, in list_resources
api_token=self.api_token,
File “/usr/local/lib/python3.6/site-packages/conjur/api.py”, line 90, in api_token
self._api_token = self.authenticate()
File “/usr/local/lib/python3.6/site-packages/conjur/api.py”, line 133, in authenticate
self.api_key, ssl_verify=self._ssl_verify).text
File “/usr/local/lib/python3.6/site-packages/conjur/http.py”, line 62, in invoke_endpoint
response.raise_for_status()
File “/usr/local/lib/python3.6/site-packages/requests/models.py”, line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://conjurmaster-qa.REDACTED.com/authn/default/admin/authenticate

Hey @chris_barber, I responded on the GitHub issue :slight_smile:.

We can use that same GitHub issue for faster cycle times if that works for you.

Cool. I wasn’t sure where I would get the best response.

Can you comment the link to the issue?

@jake Issue: https://github.com/cyberark/conjur-api-python3/issues/21