Couldn't get network list while using keystone v3 API for authentication
I have a Mirantis 9 cloud setup (OpenStack Mitaka). I am trying to write a python program which uses python clients to fetch network list. I have followed OpenStack documentation in the following link -
https://docs.openstack.org/developer/python-keystoneclient/using-api-v3.html (https://docs.openstack.org/developer/...)
So my code look like this -
auth = v3.Password(auth_url=url, user_id="user", password="abcdef", project_id="tenant1")
sess = session.Session(auth=auth)
keystone = client.Client(session=sess)
neutron = neutronclient.Client(session=sess)
print(neutron)
print(neutron.list_networks())
But after printing neutron object successfully, it failed with error message -
keystoneauth1.exceptions.http.Unauthorized: The request you have made requires authentication. (HTTP 401) (Request-ID: ....)
But the documentation does not mention other ways or other parameters needed in Password()
. So, what am I missing?
I have seen it works if I pass project_domain_name
and user_domain_name
in Password()
. What confuses me more is why this two params? Including single domain_name
doesn't work. But by definition users and the project must belong to one domain. Can user (say U) belongs to project (say P) reside in different domains (say P in domain D1, U in domain D2)?
Thanks for your help.