CustomUserStorage & KC17

First of all, good day to all. Now, My question is the next, is it possible to use the UserStorageProviderFactory in KC17? (BTW, this is already running alright in KC16, I just updated the dependencies in my pom.xml file)

What I’m doing:

  • Created a class that implements UserStorageProviderFactory and one that implements UserStorageProvider, UserLookupProvider, CredentialInputValidator, UserQueryProvider
  • Created a class that implements from org.keycloak.provider.Spi
  • 2 files in “resources/META-INF/services” named: org.keycloak.provider.Spi and org.keycloak.storage.UserStorageProviderFactory (with my Factory and mapper class names)
  • Packed my jar using maven-assembly-plugin to include the dependencies from my custom provider and copied the jar to the “providers” folder inside KC17
  • built KC using the command ./kc.sh build

If I run the command ./kc.sh show-config I can see this line:
c.provider.file.keycloak-custom-user-component.jar.last-modified = 1645896875764 (PersistedConfigSource)

Am I doing something wrong? do I have to enable something in KC17 to use a CustomUserStorageFactory? Because the servers initializes correctly, but, I can’t see my provider inside the “User Federation” screen like I do in KC16

Thanks in advance

Well, after 3 days of trying to get my jar working in KC17, I noticed that the source from github was from version 18 (yeah, I know…).

So, what did I do to get this working?

  • Downloaded the KC17 quickstart project
  • Get the configuration of the pom.xml file found in the project “user-storage-jpa”
  • Have fun… I guess…

If anyone is having trouble getting their project to work with Keycloak 17, make sure you base your pom.xml file from their quickstart guide.

I’m closing this question, if anyone needs help implementing this feel free to contact me using a PM

1 Like