How to Reset the Management Plane Admin User Password via API?

Problem

Unable to log in to the Management Plane UI using the password fetched from the output of the airctl get-creds output. Error- "Login failed"

Environment

  • Platform9 Edge Cloud - v5.3.

Procedure

Steps to update the password of the user admin@airctl.localnet from the keystone using api:

  1. Login to the DU VM, switch to root user and source the admin_admin.rc file:

root@airctl-1.pf9.localnet ~(admin)]]# source admin_admin.rc
  1. Generate new token using openstack and save it to a variable TOKEN

[root@airctl-1.pf9.localnet ~(admin)]# openstack token issue
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                                                                   |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expires    | 2025-02-22T08:57:59+0000                                                                                                                                                                |
| id         | gAAAAABnuEAXd-rz9qPMcAPWjcpKXTCJj610muLxjRzeXnLHr3qLu_eDzPo0dYY5oKgx4KdNLAg_QTPoqpx7ocAa40MnUXsgnybz_eNPmTEFu-lFzqLt3AR4k8BrGW4uZCnzauTcGWl_DQXe9G3vcytBZDRPXWXmjKXlh_Js1x40yY7Y1NiwFUw |
| project_id | 27ff3c72da5a40559b879e3fc2b9ed71                                                                                                                                                        |
| user_id    | 73ed1caef0d9478d90308a06ae95eebd                                                                                                                                                        |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

[root@airctl-1.pf9.localnet ~(admin)]# TOKEN="gAAAAABnuEAXd-rz9qPMcAPWjcpKXTCJj610muLxjRzeXnLHr3qLu_eDzPo0dYY5oKgx4KdNLAg_QTPoqpx7ocAa40MnUXsgnybz_eNPmTEFulFzqLt3AR4k8BrGW4uZCnzauTcGWl_DQXe9G3vcytBZDRPXWXmjKXlh_Js1x40yY7Y1NiwFUw"
  1. Get the user ID id the user admin@airctl.localnet from the Mysql Keystone database:

  1. Execute the POST call on the keystone API using the below curl call:

circle-info

Info

In the original password is unknown/not-working - Use PATCH api call

# curl -k -X PATCH -H "X-Auth-Token: $TOKEN" -H "Content-Type: application/json" -d '{ "user": {"password": "'<New-Password>'"} }' "https://airctl-1-3569273-767.pf9.localnet/keystone/v3/users/e34183c1320046c0a08b20021bad7b81"

  1. To Persist the changes the password needs to be updated in the MongoDB:

Log in to MongoDB docker container and verify the existing password for airctl-1-pf9-localnet-admin_pass

  1. Update the new password for theairctl-1-pf9-localnet-admin_pass and verify the change:

  1. The save the changes made in MongoDB using below command:

  1. The UI should be accessible with the new password for the user admin@airctl.localnet .

Additional Information

If the changes are not getting reflected try to stop and start the DU VM using the airctl command:

Last updated