Keycloak extension with dependencies
You have to create your SPI dependencies as jboss modules.
Steps:
Add a jboss-deployment-structure.xml file in src/main/resources/META-INF directory or your SPI with something like this (oficial documentation):
<jboss-deployment-structure> <deployment> <dependencies> <module name="org.json.json" /> </dependencies> </deployment> </jboss-deployment-structure>
Make $KEYCLOAK_HOME/modules/system/layers/base/org/json/json/main directory
Add json-20160810.jar in created dir
Add a module.xml file in same dir with this content:
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.5" name="org.json.json"> <properties> <property name="jboss.api" value="private"/> </properties> <resources> <resource-root path="json-20160810.jar"/> </resources> <dependencies> </dependencies> </module>
Compile your SPI
Restart keycloak
Redeploy your SPI
There is a better way, deploy as a EAR archive. This project shows how to: https://github.com/stianst/keycloak-experimental/tree/master/fido-u2f