1. Since Keycloak is made in Spring (a Java-based framework), ensure that you have the Java JDK installed (at least version 11) by running the following command:
root@raspberrypi / [1]# java --version
openjok 17.0.7 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+7-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.7+7-Debian-1debilu1, mixed mode, sharing)
root@raspberrypi /#
2. If that command does not print any output, you don’t have a Java JDK installed. You can install the Java OpenJDK with your package manager. In Debian, it should be something like this:
root@raspberrypi / [SIGINT]# sudo apt install default-jdk default-jre
3. Download the latest Keycloak release from their GitHub repository (it may take a few seconds to download):
root@raspberrypi ~# wget https://github.com/keycloak/keycloak/releases/download/22.0.4/keycloak-22.0.4.tar.gz
2023-10-18 21:54:49,552 INFO [org.keycloak.quarkus. runtime.hostname.DefaultHostnameProvider] (main) Hostname
4. Untar the Keycloak release:
root@raspberrypi ~# tar -xzvf keycloak-22.0.4.tar.gz
5. A new directory called something like “keycloak-{version}” should be generated; go to that directory:
root@raspberrypi ~# cd keycloak-22.0.4
6. Run the script located in bin/kc.sh to start the server, and specify an admin username and password (you only need to specify these credentials once, in subsequent runs, they are no longer needed) (if you don’t specify the port, it will use the 8080 port, please note that the first time it may take a while to start):
root@raspberrypi ~/keycloak-22.0.4# KEYCLOAK_ADMIN=admin KEYCLOAK_ADMIN_PASSWORD=uwu ./bin/kc.sh start-dev
7. And that’s it! now you can enter your Keycloak instance through http://localhost:8080 from the host computer (or with the host’s computer IP address from other devices)
8. Create a Node JS project by running the following command. (if you don’t have Node JS installed, you can download it from here: https://nodejs.org/.)
root@raspberrypi ~/tutorialKT# npm init
9. Install Keycloak-Typescript by running the following command:
root@raspberrypi ~/tutorialKT# npm install keycloak-typescript
10. And that’s it! now you can learn how to use the library on their documentation page: https://github.com/krasamo/keycloak-typescript/blob/main/docs/USAGE.md