The Keycloak Environment For Clojure
ngrok will allow us to access Keycloak from this notebook.
Settings for the ngrok configuration file. The
addr setting forwards traffic to the local port number or network address. It is set to 8080. Make sure the Keycloak default ports are free:
Grab your authtoken from ngrok, store the token in your Nextjournal secret vault, and add it to the environment. The token will authenticate this notebook with the ngrok service.
Prepend the authtoken to the configuration file above,
ngrok in the background using
nohup. Unfortunately, there are no plans to offer a daemon service in the basic ngrok package.
Place the URL into a browser and the tunnel will be visible. Anything served from port 8080 will appear here.
Start keycloak with keycloak’s
bin/standalone.sh. This runs on port 8080, make sure it is available on your machine.
Keycloak needs a default admin user as a basis. Create the admin user. I found out the hard way that
keycloak is reserved.
Open http://btf.ngrok.io/auth/. The getting started tutorial on Keycloak's official website gives detailed instructions on how to use the admin console.
To stop the ngrok tunnel or Keycloak process, use the
kill command with the process ID:
kill <PID> or
kill -9 "$(pgrep ngrok)".