Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keycloak initial login does not work with admin username and password

Tags:

login

keycloak

I cannot login to keycloak in the initial setup. I managed to run the server via /standalone.sh -b=0.0.0.0 command and when accessing it via http://x.x.x.x:8080 the login page doesn't allow me to login with admin/admin username and password. any hint is highly apreciated.

like image 905
Soheila DehghanZadeh Avatar asked Aug 30 '17 13:08

Soheila DehghanZadeh


2 Answers

In order to create the initial administrator user you need to use add-user-keycloak.sh (.bat) script located in keycloak/bin with all other scripts. Run it before starting/restarting the server, so Keycloak could pick up the user: $ ./add-user-keycloak.sh -u admin -p password.

$ ./add-user-keycloak.sh --help will show you all the available options.

like image 75
WindyFields Avatar answered Sep 17 '22 22:09

WindyFields


According to the latest keycloak documentation (today) there are two procedures to creating the first administrator credentials:

Creating the account on the local host

If your server is accessible from localhost, perform these steps. Procedure:

  1. In a web browser, go to the http://localhost:8080 URL.
  2. Supply a username and password that you can recall in the Welcome page enter image description here

Creating the account remotely

If you cannot access the server from a localhost address, or just want to start Keycloak from the command line, use the KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD environment variables to create an initial admin account.

For example:

export KEYCLOAK_ADMIN=<username>
export KEYCLOAK_ADMIN_PASSWORD=<password>

bin/kc.[sh|bat] start
like image 23
Pedro Avatar answered Sep 19 '22 22:09

Pedro