It has been awhile since I last did anything meaningful in Java, so I’m a little lost with the deployment process.
According to docs, I have to do:
1. Copy JAR file to /providers/ directory.
2. Run kc.sh build --spi-email-sender-provider=myprovider
However, I’m getting this error bellow:
ERROR: org.keycloak.email.EmailSenderProviderFactory: jar:file:///opt/keycloak/lib/../providers/notifier-1.0-SNAPSHOT.jar!/META-INF/services/org.keycloak.email.EmailSenderProviderFactory:1: Illegal configuration-file syntax
For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
Passing the --verbose parameter do not work, so I’m not sure if there are anything else to add here.
What other information should I provide would help solving this?
I was using the fully qualified, but realized I named my classes wrongly:
my.fully.qualified.name.email.Email**Send**ProviderFactory
instead of my.fully.qualified.name.email.EmailSend**ER**ProviderFactory (capitalized to illustrate)
After that and a few teaks in the re-implementations, it built successfully. I still have to verify the deployment and will update it here as soon as possible.
It builds, but it seems like it is not being used. I get the following at the top of my logs:
keycloak_dev_composed | 2023-02-16 21:47:06,562 WARN [org.keycloak.services] (build-103) KC-SERVICES0047: mysender (mysender.keycloak.provider.email.mysender.MySenderEmailSenderProviderFactory) is implementing the internal SPI emailSender. This SPI is internal and may change without notice
This is the send method with the UserModel signature.
The other send method is not implemented: just the signature and a empty body.
Nothing shows up in the logs besides the startup message and I do get the e-mail on my box, so the flow still works using the original classes. My SMTP configuration is still there on my Realm, I’m not sure if that affects anything.
This is the command line I’m using to build KC it:
I’m not sure. I will say “no”. I followed this instructions (Configuring providers - Keycloak), but I may have skipped or not fully understand how to use it.
I managed to get it working. I added --spi-email-sender-provider=mysender --spi-email-sender-provider-mysender-enabled=true to the start-dev and it did the trick.