Skip to content

Password Reset Using Keycloak Admin Page

Password Reset Using Keycloak Admin Page in Keycloak Accessing Issues.

3 min read Updated SS RS

Password Reset Using Keycloak Admin Page#

Follow the below steps to reset the password:

  1. Login to Keycloak Admin page using the below path in the browser:

    https://keycloakIP:Port/auth/
    
  2. Click on Administration Console

  3. Enter the super admin credentials.

    Username: <admin-user>
    Password: ******
    
  4. Click on Users under Manage section,

    Here we will able to see all the users created for the Account.

    Click on the ID of the Respective user for which we want to reset the password.

  5. Click on Credential Section,

    Under the “Reset Password ” section, enter the Temporary password then confirm by clicking on Reset Password button. Once you click on Reset Password, there will be prompt of Password reset successfully.

  6. Login to keycloak again: Enter the username and new temporary password.

    A new page will appear, allowing the user to set their own password.

Access Heal UI With IP Address#

Follow the below steps to access Heal UI using IP Address instead of “keycloak.example ”:

Note: The IP should be accessible from the user's desktop, before performing the below steps.

  1. Navigate to below directory:

    /<SER_INSTALL_PATH>/Appsone_Service/conf-template/appsone-ui-service
    
  2. Open the below file:

    keycloak_details.json.tpl
    

    And update the entry as below:

    From:

    "url": "https://{{ key "service/keycloak/hostname" }}:{{ key
    "service/keycloak/port/https" }}/auth"
    

    Update to:

    "url": "https://{{ key "service/keycloak/ip" }}:{{ key
    "service/keycloak/port/https" }}/auth"
    
  3. Do similar change in below directory:

    /<SER_INSTALL_PATH>/Appsone_Service/conf-template/appsone-
    controlcenter
    
  4. Restart keycloak

    Stop nomad

    nomad stop keycloak
    

    Start nomad

    nomad run keycloak
    
  5. Validate if you can access using below path:

    https://<ip>:port/appsone-ui-service
    

Note: The above files need to be changed in all the hosts.

Keycloak Service Unavailable: Connection Failure to Database Exception#

Keycloak service observations & solution:

  1. Not able to view Keycloak UI
  2. Checked Keycloak service was down
  3. Started several times but Not getting up
  4. Multiple allocation IDs are present for Keycloak while checking the status of the service
  5. Checked Keycloak nomad logs and got the error "Failed to connect to database "
  6. Run the below command to clear the allocation ID

    curl -kX PUT https://localhost:4646/v1/system/gc
    
  7. Restarted Percona DB

  8. Restarted Keycloak
  9. Checked the Keycloak docker containers for the deployment of war files success
  10. Keycloak was UP and able to access UI.

Unable to Restart keycloak#

In nomad logs, it shows Unable to connect to the database . Percona is up and running. Able to connect to database from primary node only.

Follow the below steps to rectify the issues:

  1. Issue Description: Unable to restart Keycloak.
  2. Nomad Logs Indication:
    • Nomad logs display "Unable to connect to the database."
    • Percona is operational, and the database connection succeeds only from the primary node.
  3. Keycloak Location:
    • Keycloak resides on the secondary node.
    • Keycloak fails to start due to the unavailability of MySQL from the secondary node.
  4. Firewall Blockage Identified: Examination reveals the firewall on the Percona box blocks connections from the secondary node.
  5. Firewall Resolution: The firewall on the Percona box is restarted.
  6. Successful Connection: Following firewall restart, a successful database connection from the secondary node will be achieved.
  7. Keycloak Recovery: With the firewall issue resolved, Keycloak will successfully start without any further complications.

Keycloak got into the Pending State#

Keycloak got into the pending state

Follow the below steps to rectify the issue:

  1. Check if any exception you see in the allocation logs of the service.
  2. Also please verify that, if the firewall restarted in recent times, then you have to restart the docker service.
  3. Please check if the service got killed with OOM, if yes please increase the memory in the respective nomad file and validate.

Keycloak Service is Down#

Keycloak service is not coming up and is giving null pointer exception in logs.

RCA: Keycloak was not coming up because it was unable to connect to percona with appsonedb username as this user was not present in the database.

Solution: The user has been created manually for all nodes using below queries.

CREATE USER 'appsonedb'@'<ip>' IDENTIFIED BY '<password>';
GRANT ALL ON *.* TO 'appsonedb'@'<ip>';

We have passed <password> because the same password was updated in service/perconadb/password_ui consul key.

Post this, keycloak will start successfully and UI will be accessible.