I set admin_token=ADMIN in keystone.conf
from keystoneclient.v2_0 import client
keystone = client.Client(token="ADMIN" , auth_url="http://0.0.0.0:35357/v2.0")
Traceback (most recent call last):
File "key_client.py", line 13, in <module>
keystone = client.Client(token="ADMIN" , auth_url=auth_url)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/v2_0/client.py", line 80, in __init__
self.authenticate()
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/v2_0/client.py", line 102, in authenticate
return_raw=True)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/v2_0/tokens.py", line 37, in authenticate
return self._create('/tokens', params, "access", return_raw=return_raw)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/base.py", line 82, in _create
resp, body = self.api.post(url, body=body)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/client.py", line 169, in post
return self._cs_request(url, 'POST', **kwargs)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/client.py", line 156, in _cs_request
self.authenticate()
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/v2_0/client.py", line 102, in authenticate
return_raw=True)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/v2_0/tokens.py", line 37, in authenticate
return self._create('/tokens', params, "access", return_raw=return_raw)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/base.py", line 82, in _create
resp, body = self.api.post(url, body=body)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/client.py", line 169, in post
return self._cs_request(url, 'POST', **kwargs)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/client.py", line 150, in _cs_request
**kwargs)
File "/home/mon/source_code/keystone/.venv/src/python-keystoneclient/keystoneclient/client.py", line 130, in request
raise exceptions.from_response(resp, body)
keystoneclient.exceptions.Unauthorized: The request you have made requires authentication. (HTTP 401)
-------------------------------
client = client.Client(username="admin", password="secrete", auth_url="http://0.0.0.0:35357/v2.0")
however, it works.
Now I'm in e4. In e2 they both work.
I tracked the request to token/backends/kvs.py-->Token-->get_token()--->token=self.db.get("token-%s" % token_id),
logged something out, token_id is "ADMIN", self.db is {}.
self.db is the INMEDB in common/kvs.py, however I didn't find it was filled with anything.