Extending Keycloak: how to configure the IDE (Netbeans or Eclipse)

Hi there,
I’m following the book for creating a new SPI provider and this site too: Extending Keycloak: adding API key authentication · Zakaria Amine .

Problem: I’m a Java newbie (usually I use C# and nuget) so is there a guide to create a project from scratch using Netbeans or Eclipse for having a project compatible with keycloak?

A typical Eclipse install would work fine. You should take a look at Maven, which is a popular dependency management framework. Maven also servers as the build manager and makes use of plugins to do things like compiling your project into a .jar file. I’d highly recommend looking into some tutorial just on Maven as a starter as a lot of examples on GitHub use it.

After that, I’d take a look at a UserFedoration tutorial as there are lots to choose from and they’re all on GitHub. Here’s a random one here https://www.baeldung.com/java-keycloak-custom-user-providers

Deploying an SPI to Keycloak can be done manually via the jboss-cli after you’ve packaged everything into a JAR or by wrapping the JAR and dependencies into an EAR file. I’m using the maven-ear-plugin for this.

In short, I’m not sure there’s an inclusive tutorial but hopefully I’ve dropped enough buzzwords to get your started.

1 Like

I found this page to be EXTREMELY helpful:

There are a few inaccuracies/confusing sections (probably because the author is French), but it got me up and running with a dev environment so I could write and debug extensions. I’m likewise a Java n00b (well, it’s been a decade), so it took me a little while to figure things out.

I also recommend looking at these two projects:

The second one is a little bit older. You need to look at the pom.xml files to update the Keycloak version to 14.0.0 (or whatever the current version is at the time that someone in the future may read this). Figuring out how Maven works took me a little while, as well, but these projects gave me a great place to start.