Ask Your Question

How can I change tenant password with REST API call

asked 2015-07-07 10:17:57 -0500

Ginko gravatar image

updated 2015-07-07 10:20:17 -0500

I know how it can be done with CLI command, but I try to replicate this behavior with rest-api call. Here is the CLI command I want to replicate with rest-api call :

keystone user-password-update --pass $PASS $TENANT

I try a few things, but didn't find something that work. when I run this CLI command with --debug it's look like there is a PUT made, but there is not that much information how to replicate it:

DEBUG:urllib3.connectionpool:"PUT /v2.0/users/f17c65fea3864123daf8aa1b21ad75081/OS-KSADM/password HTTP/1.1" 200 258
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-07-07 10:53:17 -0500

uts9 gravatar image

Run this after getting the token


curl \
 -H "X-Auth-Token: $OS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{ "user": {"password": "'$NEW_PASS'", "original_password": "'$ORIG_PASS'"} }' \

Please check this document for more info.

edit flag offensive delete link more


Thanks for the quick reply, I found in the link you post what I need.

Ginko gravatar imageGinko ( 2015-07-07 13:15:18 -0500 )edit

answered 2015-07-07 13:03:32 -0500

Ginko gravatar image

updated 2015-07-07 13:40:51 -0500

To change the password without knowing the origin password (admin OS_TOKEN is needed) :

curl -s -X PATCH \
 -H "X-Auth-Token: $OS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{ "user": {"password": "'$NEW_PASS'"} }' \
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-07-07 10:17:57 -0500

Seen: 991 times

Last updated: Jul 07 '15