Keycloak setup
Overview
In this second day of the Keycloak Advent Calendar, we'll walk you through the steps to set up Keycloak for a trial. It does not mention complicated settings. It's easy, so if you're interested, give it a try: slight_smile:
The setup procedure is as follows.
- Download Keycloak
- Start the server
- Create an admin user
- Login to the management console
In addition to this, this page also touches on how to Japaneseize and uninstall Keycloak.
For more information, please refer to Keycloak Guides. Japanese translation of the guide is also available on NRI OpenStandia (translated as of December).
System requirements
The requirements for launching Keycloak are as follows:
--OS that can execute Java
- Java 8 JDK
--RAM 512M or more
--1G or more disk space
Setup procedure
This section describes the procedure from starting the Keycloak server, setting the administrator user, and logging in to the management console.
Download Keycloak
Download the Keycloak compressed file from the Keycloak Download Page.
Start the server
After downloading, unzip it to a suitable directory. Running standalone.sh
or standalone.bat
in the bin
directory will start the Keycloak server.
--For Linux / Unix:
$ unzip keycloak-3.3.0.CR2.zip
$ ./bin/standalone.sh
--For Windows:
> unzip keycloak-3.3.0.CR2.zip
> bin\standalone.bat
In addition, "Wildfly" (Java EE container developed mainly by Red Hat) is included in the compressed file of Keycloak. Keycloak runs on top of this Wildfly.
: warning: By default, Keycloak does not allow access from remote hosts. This is due to WildFly's default specifications. To cancel this, add the IP address of the host allowed by the -b option to the startup script. If it is "0.0.0.0", all hosts are allowed. $ ./bin/standalone.sh -b = 0.0.0.0
If the following message is displayed on the console, the startup is complete.
14:29:22,241 INFO [org.jboss.as](Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
14:29:22,241 INFO [org.jboss.as](Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
14:29:22,241 INFO [org.jboss.as](Controller Boot Thread) WFLYSRV0025: Keycloak 3.3.0.CR2 (WildFly Core 3.0.1.Final) started in 12515ms - Started 536 of 858 services (570 services are lazy, passive or on-demand)
: information_source: If you want to stop the server, click Ctrl + C on the console.
Creating an admin user
After the server starts, open a browser and go to http: // localhost: 8080 / auth. The following page will be displayed.
Keycloak does not have an administrator account set by default. First you need to create it on the welcome page. With the created administrator account, you can create users, set authentication methods, register applications protected by Keycloak, and so on.
: information_source: If you want to access localhost, you can only create an initial admin user. This is a security measure. You can also use the script add-user-keycloak.sh </ code> to create an initial admin user on the command line. For more information, see the guides (Server Installation and Server Administration. Please refer to /index.html)).
Login to the management console
After creating an administrator account, you can log in to the admin console.
Click the "Administration Console" link at the bottom of the welcome page.
Enter the username and password you created on the welcome page. The Keycloak Management Console main page is displayed.
If you want to know about a setting item in the management console, hover the mouse over the? (Question mark) icon and a text explaining the setting item will pop up.
Localizing into Japanese
Keycloak is internationalized and Japanese is also supported. To translate the management console and user account services into Japanese, follow the steps below.
Click the "Themes" tab, set the "Internationalization Enabled" setting to "ON", and click the "Save" button.
Once you log out, Japanese localization should be completed, but it may not be reflected immediately due to cache etc. In that case, click the link labeled "Admin" on the right and select "Manage account".
There is a language setting at the top of the screen, so click it and select Japanese.
That's it. Please log out once to confirm.
When you try to log in again, a select box for selecting the language will appear on the login screen.
If you log in after specifying Japanese here, the screen that was in English will be displayed in Japanese.
Uninstall Keycloak
No special work is required to uninstall Keycloak. Basically, just delete the unzipped directory.
Reference material
| |