[英]Fiware Keyrock how to authenticate from python-keystoneclient
I am using fiware-idm. 我正在使用fiware-idm。 I find python-keystone client to to interact with keystone API with easy way . 我发现python-keystone客户端可以通过简单的方法与keystone API进行交互。 But I have problem with authentication. 但是我在身份验证方面有问题。 creating regular user with default "idm" user it's not problem . 使用默认的“ idm”用户创建普通用户没问题。 but i can not find way how to autenticate this user. 但我找不到办法来增强这个用户的能力。
here is my test samples : create user : 这是我的测试样本:创建用户:
def create_user():
user = keystone.users.create(name="user4",
default_project="idm",
domain="default",
password="qwerty",
email="user4@email.com",
description="this is user description",
enabled=True,
username="user4")
return user
authentication: 验证:
auth = v3.Password(auth_url="http://192.168.33.10:5001/v3",
username="user4",
password="qwerty",
domain_name="idm"
)
sess = session.Session(auth=auth)
keystone = client.Client(session=sess)
print keystone.users.list()
It writes that : 它写道:
keystoneclient.exceptions.Unauthorized: The request you have made requires authentication. (HTTP 401)
Answering you last comment, @beka, it seems to be an issue on the Cloud Portal images for version 4.4.1. 回答您最后的评论@beka,这似乎是4.4.1版的Cloud Portal映像上的问题。
It will be fixed in versión 5.1.0, which will be released this week, so I recommend you to use that version images. 它将在本周发布的5.1.0版中修复,因此我建议您使用该版本的映像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.