1

My openstack version is ocata. In my computer I installed the openstacksdk (0.9.18), when I use it to create a openstack user like bellow:

# create openstack user
user_args = {
    "default_project_id":new_project.id,  # the project is created already, there I did not post here.
    "email":email,
    "is_enabled":True,
    "name":username,  
    "pasword":password,  
}

try:
    new_user = super_conn.conn.identity.create_user(**user_args)
except Exception as e:
    raise e

try:
    role_user = super_conn.conn.identity.find_role(OPENSTACK_ROLE_USER) # there I find the role(user)
    new_project.assign_role_to_user(super_conn.conn.session, new_user, role_user)  # assign to the new user
    new_project.validate_user_has_role(super_conn.conn.session, new_user, role_user)
except Exception as e:
    raise e

I have debug the username and password in my code, my code is no mistake.

I created the new_user, and I also in openstack dashboard, checked the user and the user's project. But I can not use the username and password to login the openstack dashboard.

Whether there is something wrong with it?

the error means the credentials invalid. So, I use openstack admin user to change the created user's password, then I can login yet.

aircraft
  • 25,146
  • 28
  • 91
  • 166
  • How could you `change the user's password` ? Could you help me this question ? https://stackoverflow.com/questions/69616030/how-openstacksdk-change-current-user-password , thanks so much. – Victor Lee Oct 18 '21 at 12:29

1 Answers1

1

You didn't mention anything about roles for the user. Maybe the problem is lack of a role of any sort.

FreshPow
  • 6,782
  • 1
  • 15
  • 17
  • I don't see anything wrong and I was just looking at the identity api and I'm kind of surprised the password isn't supposed to be base64 encoded to allow various special characters, but I don't see anything about that. – FreshPow Dec 13 '17 at 18:25