Skip to content

Keycloak-CC-UI and CC Logs Access Denied Error

Keycloak-CC-UI and CC Logs Access Denied Error in Keycloak Accessing Issues.

5 min read Updated SS RS

Keycloak-CC-UI and CC Logs Access Denied Error#

An SQL access denied error for the user 'appsonedb'@'192.0.2.63' is encountered.

Solution:

  1. Username Change in Consul: Alter the username in the Percona consul key from 'appsonedb ' to 'dbadmin ', it resolves the permission issues:

    consul kv put service/perconadb/username dbadmin
    
  2. Consistency Check: Ensure that the key in the consul matches the database configuration to prevent such issues.

Keycloak Health check#

Keycloak repeatedly fails and restarts, indicated by the healthcheck being marked as unhealthy.

Solution:

  1. Resource Allocation: Increase the resources allocated to Keycloak in the keycloak.nomad file.
  2. Healthcheck Modification: If the healthcheck issue persists and is not required, consider removing the healthcheck from the keycloak.nomad file.
  3. Deployment Verification: After making changes, verify the deployment using:

    nomad plan keycloak.nomad
    
  4. Service Restart: Restart Keycloak and check its status.

APM Tool Security Review Process#

  1. Login Attempt Limit:
    1. In the Keycloak admin console, navigate to Realm Settings → Security Defenses → Brute Force Detection.
    2. Enable and configure the number of login attempts.
  2. Inactivity Timeout Setting:
    1. Go to Clients → appsone-sso → Settings → Advanced Settings.
    2. Set the Client Session Idle value to the desired duration.

Keycloak UI Port Changes#

Keycloak service restart issue due to port configuration.

Solution:

  1. Network Mode Adjustment: Change the network mode to "host " in the keycloak.nomad file.
  2. Configuration File Modification:
    1. Copy standalone-ha.xml from the Docker container to a local path.
    2. Edit standalone-ha.xml to change the port to “ ${jboss.https.port:9192}” and update this in the keycloak.nomad file.
  3. Firewall Configuration: Add an entry for the Keycloak port in the firewall settings.
  4. Service Restart: Restart the Keycloak service to apply changes.

Issue with Keycloak Starting#

Keycloak fails to enter the running state because of missing Consul keys. This issue was observed in a common scenario, such as with the customer, where clients upgraded from a mid-July to a mid-September release. Despite Consul keys in Consul, the latest supervisor controller was not copied to all the Heal nodes during the upgrade.

Solution:

  1. Manual Copy of Supervisor Controller: To address the missing keys, manually copy the supervisor-controller directory to all Heal servers. This step is necessary due to its absence in some nodes post-upgrade.
  2. Consul Key Addition: Encounter an issue with a missing Consul key (service/rabbitmq/outputQname a1-event-messages) during the Keycloak restart process.

    For Example: Added this specific Consul key:

    consul kv put service/rabbitmq/outputQname a1-event-messages
    
  3. Service Restart and Verification:

    1. After adding the missing Consul key, restarted Keycloak.
    2. Post-restart, confirm that the Keycloak was up and running without further issues.

HEAL CC and UI Page Intermittent Logouts#

Users experience intermittent logouts from the HEAL CC and UI pages.

Cause: The issue was attributed to the use of an incorrect URL for accessing CC/UI. Specifically, the URL contained a service name not available for the Example client, leading to redirections to the login page upon credential submission.

Evidence: The following error was observed in the appsone UI logs: “ user does not have access to service (13).”

Resolution:

The problem was resolved by using the correct URL to access the CC/UI pages.

Keycloak User Sync Workaround Procedure#

Keycloak user sync is not occurring in Heal2x. The provided procedure ensures synchronization of user identifiers between the Appsone Keycloak user entity and Appsone user attributes tables.

Procedure: Manual User Identifier Update

If manual intervention is necessary, update the identifiers in the specified tables using the following SQL queries:

  1. Update user_attributes table:

    UPDATE user_attributes SET user_identifier='b3179f6d-557b-46ee-b453-5689f1b498de' WHERE user_identifier='dc67c788-299c-4475-a766-129358ee0c4d' AND username='100696';
    
  2. Update user_access_details table:

    UPDATE user_access_details SET user_identifier='b3179f6d-557b-46ee-b453-5689f1b498de' WHERE user_identifier='dc67c788-299c-4475-a766-129358ee0c4d';
    
  3. Update user_forensic_notification_mapping table:

    UPDATE user_forensic_notification_mapping SET applicable_user_id='b3179f6d-557b-46ee-b453-5689f1b498de' WHERE applicable_user_id='dc67c788-299c-4475-a766-129358ee0c4d';
    
  4. Update user_notification_choice table:

    UPDATE user_notification_choice SET applicable_user_id='989dc9bd-d131-45cd-837e-6772d63d585a' WHERE applicable_user_id='5dd8a3cc-1642-4844-9dff-698864b037da';
    
  5. Update user_notification_mapping table:

    UPDATE user_notification_mapping SET applicable_user_id='b3179f6d-557b-46ee-b453-5689f1b498de' WHERE applicable_user_id='dc67c788-299c-4475-a766-129358ee0c4d';
    

Keycloak Access Issue After Migration#

After migrating from Keycloak version 5.x to 2.x, users were unable to access the Keycloak page.

The error reported as below:

(ServerService Thread Pool -- 60) app-host-01: no members discovered after 3005 ms: creating cluster as coordinator.

RCA: The issue was traced back to the /etc/hosts file where 127.0.0.1 was incorrectly pointing to the user’s hostname instead of localhost. This misconfiguration affected the Keycloak IP app-host-01 as identified within the Keycloak container.

Solution: Correct the /etc/hosts file to accurately point 127.0.0.1 to localhost and add the correct Keycloak IP, then the Keycloak service will be restarted.

Also, access to the Keycloak UI and authentication page will be restored.

Keycloak Authentication Page Access Error#

Accessing the Keycloak authentication page resulted in a 404 error.

RCA: The error was attributed to an invalid address binding as indicated by the below error message:

java.net.BindException: [UDP] /192.0.2.93 is not a valid address on any local network interface

This occurred due to multiple IP addresses being pointed to the hostname, a result of the extra_hosts section mounted inside the Keycloak Nomad file.

Solution:

  1. Nomad File Adjustment: The extra_hosts section was removed from the Keycloak Nomad file to correct the IP address binding issue.
  2. Keycloak Restart: Keycloak was restarted, resolving the issue and allowing normal operation.

Keycloak Failing to Login with the AD User Credentials#

Issue: Users consistently revert to a disabled state, even after being enabled daily.

RCA: Identified that users get disabled in Keycloak, which seems to stem from their accounts being disabled at the AD level. As a result, when these users are synchronized, they maintain the same disabled state in Keycloak. Consequently, even if we attempt to enable these users from the CC interface, the CC system simply retrieves and reflects the current status from Keycloak.

Solution:

To resolve this issue, manually re-enable the users disabled in Keycloak through toggle button.