update an admin user password via the REST API?

Announcements
Attention: The LIVEcommunity is experiencing an interruption with videos in some areas. We apologize for any inconvenience this may cause. Thank you for your patience as we work towards a solution to restore videos.
Reply
Highlighted
L0 Member

update an admin user password via the REST API?

I have searched high and low but have not found a way to set a password for an admin user via the API.  Does anybody know if this is even possible or if you need to use the UI or CLI only?

Marc

Highlighted
L6 Presenter

Re: update an admin user password via the REST API?

Gave it a shot but I believe I'm missing something here as well.

10-3-2013 9-35-18 PM.png

10-3-2013 9-35-28 PM.png

Highlighted
L4 Transporter

Re: update an admin user password via the REST API?

Hello,

Here's the xpath value that worked for me:

xpath=/config/mgt-config/users/entry[@name='admin1']/fnRL/G5lXVMug

It should say:

<response status="success" code="19">

<result/>

</response>


Thanks,

Aditi

Highlighted
L0 Member

Re: update an admin user password via the REST API?

Aditi,

I ran this as well with a success code, but it does not appear to change any passwords.  Did you confirm you were able to log in with a new password after the above change?  Also what password is set by that api call? 

Thanks,

Marc

Highlighted
L4 Transporter

Re: update an admin user password via the REST API?

Here is the correct call to modify the phash value of an administrator.

http://<firewall>/api/?type=config&action=set&key=<key>&xpath=/config/mgt-config/users/entry[@name='username']&element=<phash>password</phash>

Replace the <firewall>, <key>, username, and password attributes to appropriate values.  Once the call is made you should be able to see the changed value via the get API call but the change will not take effect until a commit is completed.

You can also use an API call to generate the password hash.

http://<firewall>/api/?type=op&cmd=<request><password-hash><username>user</username><password>password</password></password-hash></request>

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!