Ask Your Question

Revision history [back]

You don't need to create any v3 endpoints. You can use either v3 plugin or generic plugin. If you use generic plugin for auth, then you don't need to specifcy the identity version.

from keystoneclient.auth.identity import v3
from keystoneclient import session
from keystoneclient.v3 import client

auth = v3.Password(auth_url="http://localhost:35357/v3",
                   username="admin",
                   password="password",
                   project_domain_name='default',user_domain_name='default',
                   project_name="admin")
sess = session.Session(auth=auth)
keystone = client.Client(session=sess)

print keystone.users.list()

print "Using GenericPassword Plugin".center(60)
from keystoneclient.auth.identity.generic.password import Password as GenericPassword

auth = GenericPassword(auth_url="http://localhost:35357",
                   username="admin",
                   password="password",
                   project_domain_name='default',user_domain_name='default',
                   project_name="admin")
sess = session.Session(auth=auth)
keystone = client.Client(session=sess)

print keystone.users.list()

You don't need to create any v3 endpoints. You can use either v3 plugin or generic plugin. If you use generic plugin for auth, then you don't need to specifcy the identity version. In your code, just check what is the value of "auth_url", that determines everything

from keystoneclient.auth.identity import v3
from keystoneclient import session
from keystoneclient.v3 import client

auth = v3.Password(auth_url="http://localhost:35357/v3",
                   username="admin",
                   password="password",
                   project_domain_name='default',user_domain_name='default',
                   project_name="admin")
sess = session.Session(auth=auth)
keystone = client.Client(session=sess)

print keystone.users.list()

print "Using GenericPassword Plugin".center(60)
from keystoneclient.auth.identity.generic.password import Password as GenericPassword

auth = GenericPassword(auth_url="http://localhost:35357",
                   username="admin",
                   password="password",
                   project_domain_name='default',user_domain_name='default',
                   project_name="admin")
sess = session.Session(auth=auth)
keystone = client.Client(session=sess)

print keystone.users.list()