Deploy code in keycloak for provider

I want to add a provider to keycloak, for this I got help from GitHub - dasniko/keycloak-2fa-sms-authenticator: Keycloak Authentication Provider implementation to get a 2nd-factor authentication with a OTP/code/token send via SMS (through AWS SNS). Demo purposes only!, now I am building my project and the jar file that is created is in the path where keycloak is in I place the provider section and then execute the kc.bat build command and run keycloak, but the things I want like sms-authenticator are not built in keycloak.
And I am using version 23.0.5 of keycloak

1 Like

We have the same problem.
We want to deploy a new provider but after we created the jar file and we built it with “ build” the step in “Authentication” secction doesn’t appear.

We would appreciate some help.

So if you want to add custom extensions to Keycloak you need to package them in a JAR and put it in the docker container running keycloak in a specific location specified in the docs. I think will be helpful so show how you do that and what are the relevant logs when you start the server.

FYI: before Quarkus you could have simply put the jar in the location after the Keycloak started, but now the jar needs to be already there in the container before is started

Hi, Thanks for your respond.
The procedure we have followed is the following:
We have generated the jar files of the dasniko project, once generated we have copied them to the folder where we built the Docker image. Through the Dockerfile we copy the files in the providers folder into container and execute the build command.
Once the container is deployed, if we execute the command ./ show-config appear:
bash-5.1$ ./ show-config
Current Mode: production
Current Configuration:

kc.optimized = true (PersistedConfigSource)
kc.provider.file.dasniko.keycloak-2fa-sms-authenticator.jar.last-modified = 1707377655000 (PersistedConfigSource)
kc.provider.file.original-dasniko.keycloak-2fa-sms-authenticator.jar.last-modified = 1707377655000 (PersistedConfigSource)
kc.version = 23.0.6 (SysPropConfigSource)

As you can see provides appear to be loaded but when we try to add them to the authentication flow they do not appear: