Ask Your Question
0

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
2

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

uts9 gravatar image

Run this after getting the token

USER_ID=b7793000f8d84c79af4e215e9da78654
ORIG_PASS=userpwd
NEW_PASS=newuserpwd

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

Please check this document for more info.

edit flag offensive delete link more

Comments

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
0

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'"} }' \
 http://localhost:5000/v3/users/$USER_ID
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 763 times

Last updated: Jul 07 '15