'Keycloak Userstorage SPI: Provider not found?

What are the requirments to make the Keycloak 17.0.0 find the provider?

[error]: Build step org.keycloak.quarkus.deployment.KeycloakProcessor#configureProviders threw an exception: java.util.ServiceConfigurationError: org.keycloak.storage.UserStorageProviderFactory: Provider my.own.package.UserStorageProviderFactoryImpl not found

If I clone the project from baeldung and I start the keycloak, it works. It finds the provider. (https://www.baeldung.com/java-keycloak-custom-user-providers)

As I see the followings have to happen to make it work:

  • have a class that implements the UserStorageProviderFactory interface:

public class UserStorageProviderFactoryImpl implements UserStorageProviderFactory<MyImplementation> {}

  • create the META-INF and services folders and create the org.keycloak.storage.UserStorageProviderFactory file that contains the path to given factory:

enter image description here enter image description here

  • mvn clean package --> copy jar to Keycloak/providers and should work

What do I miss? What is extra in the baeldung project that make it work while my project is not found when I start the keycloak?

https://www.keycloak.org/docs/latest/server_development/index.html#_user-storage-spi



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source