Keyloak 17/18 override internal SPI

Dear forum members

The customer is using a custom email solution to send emails via Keycloak. The original extension was based on Link To Tutorial which was working without any issues.

I have now upgraded the client to be Quarkus compatible but the solution doesn’t seem to work anymore. I have installed the extension in the quarkus based Keycloak (17/18). I can see in the logs that Keycloak has deployed it and initialized by the inlcuded factory but if I call it.

It seems that it will execute the DefaultEmailProvider.
The problem is probably that the EmailProvider is an internal spi therefore I would probably need to specify that I want to replace the default one. Sadly, there is no documentation about this.

How can I achieve it without compile Keycloak from scratch?

Thank you in advance.

That’s not true.
Here it is: Configuring providers - Keycloak

1 Like

Thank you very much for the link and the fast reply. I was not aware that this page exists.

I have tried to apply the configuration according to the page. The id of the custom impl. is “comotiveapi” the internal spi is called “emailSender” according to the source code. I have tried to apply the rules as follows:

RUN /opt/keycloak/bin/ build --spi-email-sender-provider=comotiveapi --spi-email-sender-comotiveapi-enabled=true

I also increased the logs for the build command and the runtime it didn’t show that the system was touched or the configuration did something.

Is there an error in my thinking or is there a way to debug it?

Thank you in advance.

It seems my assumptions from my last comment were correct, but it seems that it only worked for me with Keycloak 18.0.0 and production mode.