[Openstack] Change user password (not admin)

Gabriel Hurley Gabriel.Hurley at nebula.com
Wed Jun 6 18:55:00 UTC 2012


I've had this fight with Joe Heck and Termie before. They rejected my attempts to modify the Keystone code to allow a user to change their own password. I believe their grounds were a combination of it being an "admin" activity, and that adding it to the "user" API would change the API contract and couldn't be done in until v.next of the API.

Feel free to have at it with them again. ;-)


-          Gabriel

From: openstack-bounces+gabriel.hurley=nebula.com at lists.launchpad.net [mailto:openstack-bounces+gabriel.hurley=nebula.com at lists.launchpad.net] On Behalf Of Guillermo Alvarado
Sent: Wednesday, June 06, 2012 9:24 AM
To: openstack at lists.launchpad.net
Subject: [Openstack] Change user password (not admin)

Hi everyone!

I am trying to develop a new feature to horizon, I want to users can update their own password.
I used this:

from horizon import api

api.user_update_password(
    request,
    request.user.id<http://request.user.id>,
    form.cleaned_data['new_password'],
    admin=True
)

But  the user is logged out because in keystone.py there is this:

if not user.is_admin():
            raise exceptions.NotAuthorized

So, Only the user admin can use that method.

How can I be able to use this method with a normal user, or do you recommend to query the database directly to modify the password in the user table.

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120606/3b8ad0a7/attachment.html>


More information about the Openstack mailing list