I installed the latest version of Keycloak on a Linux EC2 instance. After starting Keycloak, I accessed it via the following URL: https://“mydomain”:8443/
The Keycloak interface appeared with this message:
‘Local access required
You will need local access to create the temporary administrative user.
To create the temporary administrative user, open https://localhost:8443/, or set the environment variables KC_BOOTSTRAP_ADMIN_USERNAME and KC_BOOTSTRAP_ADMIN_PASSWORD when starting the server.’
I set these environment variables, restarted Keycloak, and accessed it again at: https://“mydomain”:8443/admin/
The login screen appeared, where I entered the username (admin
) set in KC_BOOTSTRAP_ADMIN_USERNAME
and the password set in KC_BOOTSTRAP_ADMIN_PASSWORD
. However, I couldn’t log in.
Here is the relevant log output:
2024-11-01 14:24:33,004 WARN [org.keycloak.events] (executor-thread-4) type="LOGIN_ERROR", realmId="<realmId>", realmName="master", clientId="security-admin-console", userId="null", ipAddress="<ipAddress>", error="user_not_found", auth_method="openid-connect", auth_type="code", redirect_uri="https://<mydomain>:8443/admin/master/console/", code_id="<code_id>", username="admin"
The environment variables appear to be set correctly. How can I successfully log in with the temporary administrative user?
I have tried the following approaches:
export KC_BOOTSTRAP_ADMIN_USERNAME=admin
export KC_BOOTSTRAP_ADMIN_PASSWORD=mypassword
bin/kc.sh start-dev
sudo -E bin/kc.sh start-dev
KC_BOOTSTRAP_ADMIN_USERNAME=admin KC_BOOTSTRAP_ADMIN_PASSWORD=mypassword bin/kc.sh start-dev
I also added the following to .bash_profile
:
export KC_BOOTSTRAP_ADMIN_USERNAME=admin
export KC_BOOTSTRAP_ADMIN_PASSWORD=mypassword
However, I still get the same error as at the start, no matter which approach I try.
Any help or guidance would be much appreciated.