Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

rest api to change password for ambari users

rest api to change password for ambari users

i want to change ambari users passwords using ambari rest api and want to design a webpage so there i can provide a button when user click on reset button it prompt to change password ? how rest api can be integrated to web language ?

1 REPLY 1

Re: rest api to change password for ambari users

Super Mentor

@Anurag Mishra

Example:

# curl -i -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"Users/password":"jaypwd1","Users/old_password":"admin"}' http://amb25101.example.com:8080/api/v1/users/jay


HTTP/1.1 200 OK
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
Set-Cookie: AMBARISESSIONID=wzd7yk0ho2sq1dlip3au1lscq;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Content-Type: text/plain
Content-Length: 0


Example:
Here : In the "old_password" please enter the ambari admin password (it is not the old password of "jay" user, Instead it is ambari admin password.)
Changed "amb25101.example.com" with your ambari server FQDN
username "jay" with your desired username whose password you want to change.
"jaypwd1" is the new password for user "jay"

.