ldapkeycloakkeycloak-serviceskeycloak-connect

Keycloak adding custom UserStorageProviderFactory lead to the removal of other default user storage provider


I'm using Keycloak version 21.0.2 and I have a custom provider for the UserStorageProviderFactory with the id 'demo-user-provider'.

I follow the Keycloak documentation and put the factory classpath in the META-INF/services/org.keycloak.storage.UserStorageProviderFactory file. I build my custom provider project into a jar file and put it in the providers folder of Keycloak. Then I run the "kc.sh build" command. My custom provider is appearing correctly in my Keycloak instance, but the other default storage providers like LDAP or Kerberos are disappearing, which is not good. enter image description here

Do you know why it removes the other default user storage provider and how to fix it?


Solution

  • At last, I found the problem came from the config of my pom.xml file, I imported dependency keycloak-model-legacy but forgot to add the scope provided. The build process does not raise any warning or error and my custom provider is imported correctly but the other default provider will be removed. Adding back the provided scope solves the problem. This one only happens when you forget to add the scope provided along with the usage of maven-shade-plugin