API Developer Portal : How to unlock the admin account and reset its password
search cancel

API Developer Portal : How to unlock the admin account and reset its password

book

Article ID: 95946

calendar_today

Updated On:

Products

CA API Developer Portal CA API Gateway

Issue/Introduction

  • How do I unlock the admin account and reset it's password in CA API Developer Portal ("Portal")?


Environment

  • CA API Developer Portal 4.5 and above

Resolution

  • When the admin user is locked (due to several login attempts with wrong password), the database can be updated to revert the user status and reset the password to a default value. The steps below will allow the account to be unlocked and the password to be reset.

Postgres Database:

  1. Unlock the admin user account.
    1. ​Run the following to quickly identify the Database container: docker ps | grep portal_portaldb.1   ​
    2. From the output, retrieve the container ID and use it to gain access to its shell prompt: docker exec -it <CONTANEIR_ID> /bin/sh
    3. Once at the prompt, run the following to access postgres console: psql portal admin
    4. Enable the postgres expanded output format by running: # \x
    5. Review the admin account lock status by running the following query: select * from user_info where username='admin';
    6. You should see that the locked account has the status set to "locked" and invalid_login_attempt set to a number greater than 3.
    7. Update the table that is locking the account by running the following: update user_info set status='ENABLED', invalid_login_attempt=0 where username='admin' and tenant_id='apim';
  2. Reset the admin user password.
    1. To reset the admin password back to the default of 7layereyal7, the following query should be run: update user_info set password_salt='5b6085dc-461e-4698-afb6-2ed0cf6c88df', password_hash='AcXNHGp/7/8FYgd9VatEU8AuzJmRsR0DUt2zN9qw40nJFGr3B6Kd0Le7A2YhT6NnCEiNNFf05YOXjR9YGqZk3A==' where username='admin' and tenant_id='apim';
    2. ​Log into Portal Web UI and assign a new password to the admin user.

External MySQL Database:

     1. Unlock the admin user account.

           a. Connect to mysql database: use portal;
           b. Review the admin account lock status by running the following query: select * from USER_INFO where username='admin';
           c. You should see that the locked account has the status set to "locked" and invalid_login_attempt set to a number greater than 3.
           d. Update the table that is locking the account by running the following: 
               update USER_INFO set status='ENABLED', invalid_login_attempt=0 where username='admin' and tenant_id='apim';
    

     2. Reset the admin user password.

           a. To reset the admin password back to the default of 7layereyal7, the following query should be run: update USER_INFO set password_salt='5b6085dc-461e-4698-afb6-2ed0cf6c88df', password_hash='AcXNHGp/7/8FYgd9VatEU8AuzJmRsR0DUt2zN9qw40nJFGr3B6Kd0Le7A2YhT6NnCEiNNFf05YOXjR9YGqZk3A==' where username='admin' and tenant_id='apim';
​           b. Log into Portal Web UI and assign a new password to the admin user.