Keycloak Authenticator SPI Example not working because of wrong relative path in pom.xml

Hello
I followed the walkthrough for setting up a custom authenticator spi for keycloak.I’m trying to use the example code from https://github.com/keycloak/keycloak/tree/master/examples/providers/authenticator . But when I run mvn clean install wildfly:deploy i’m getting this error :

`FATAL] Non-resolvable parent POM for org.keycloak:keycloak-examples-parent:8.0.0-SNAPSHOT: Could not find artifact org.keycloak:keycloak-parent:pom:8.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ org.keycloak:keycloak-examples-parent:8.0.0-SNAPSHOT, C:\Users\dazoulay\Downloads\keycloak-master\keycloak-master\examples\pom.xml, line 20, column 13`
1 Like

The old examples were not designed to be used directly from the GitHub clone, but rather from the download on the website. Try downloading the examples from https://www.keycloak.org/downloads.html.

1 Like

So I just downloaded the examples from the Downloads page and tried the LDAP example. The error is the same as if I’d downloaded the GitHub clone:

david.a.sharpe@CA-L2TTLPQ2 MINGW64 /c/Dev/keycloak-examples-8.0.1/ldap
$ mvn install
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.keycloak:keycloak-examples-parent:8.0.0-SNAPSHOT: Failure to find org.keycloak:keycloak-parent:pom:8.0.0-SNAPSHOT in https://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ org.keycloak:keycloak-examples-parent:8.0.0-SNAPSHOT, C:\Dev\keycloak-examples-8.0.1\pom.xml, line 20, column 13
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.keycloak.example.demo:keycloak-examples-ldap:8.0.0-SNAPSHOT (C:\Dev\keycloak-examples-8.0.1\ldap\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.keycloak:keycloak-examples-parent:8.0.0-SNAPSHOT: Failure to find org.keycloak:keycloak-parent:pom:8.0.0-SNAPSHOT in https://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ org.keycloak:keycloak-examples-parent:8.0.0-SNAPSHOT, C:\Dev\keycloak-examples-8.0.1\pom.xml, line 20, column 13 -> [Help 2]

Notably the Downloads page does say that the Examples are DEPRECATED, so I guess that’s that. Now the “Downloads” page has “Quickstarts distribution” under the “Examples” heading, but there is no LDAP example.

I think there is some issue with the Keycloak examples and the version
in the pom.xml.

Maybe the easiest to fix is to checkout whole repository
http://github.com/keycloak/keycloak” and then just build the hole
Keycloak server to your local maven repo.
cd keycloak
mvn clean install -DskipTests=true
cd examples/ldap/target/ (Directory target should be there if example
was successfully built)

Oddly enough, examples/ldap/target/ is not there after successfully building the whole Keycloak server. I looked in the top level pom and found an “examples” profile, so I tried mvn install -DskipTests=true -Pexamples but that didn’t create the examples/ldap/target/ directory either. I can see that building was successful though: adapters/oidc/tomcat/tomcat/target exists, for example.

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Keycloak 9.0.0-SNAPSHOT:
[INFO]
[INFO] Keycloak BOM Parent ................................ SUCCESS [  1.901 s]
[INFO] Keycloak BOM for adapters .......................... SUCCESS [  0.050 s]
[INFO] Keycloak BOM for server extensions ................. SUCCESS [  0.034 s]
[INFO] Keycloak BOM utilities for the quickstarts ......... SUCCESS [  0.050 s]
[INFO] Keycloak ........................................... SUCCESS [  0.083 s]
[INFO] Keycloak Common .................................... SUCCESS [  3.283 s]
[INFO] Keycloak Core ...................................... SUCCESS [  3.434 s]
[INFO] Keycloak Server SPI ................................ SUCCESS [  1.999 s]
[INFO] Keycloak Server Private SPI ........................ SUCCESS [ 10.584 s]
[INFO] Keycloak Kerberos Federation ....................... SUCCESS [  0.300 s]
[INFO] Keycloak LDAP UserStoreProvider .................... SUCCESS [  0.950 s]
[INFO] Keycloak SAML Core Public API ...................... SUCCESS [  5.950 s]
[INFO] Keycloak SAML Core ................................. SUCCESS [  3.167 s]
[INFO] Keycloak REST Services ............................. SUCCESS [  7.200 s]
[INFO] Keycloak JS Integration ............................ SUCCESS [  3.634 s]
[INFO] Keycloak Themes .................................... SUCCESS [  4.916 s]
[INFO] Keycloak Dependencies Parent ....................... SUCCESS [  0.033 s]
[INFO] Keycloak Dependencies Server Min ................... SUCCESS [  0.084 s]
[INFO] Keycloak Model Parent .............................. SUCCESS [  0.066 s]
[INFO] Keycloak Model JPA ................................. SUCCESS [  1.734 s]
[INFO] Keycloak Model Infinispan .......................... SUCCESS [  3.416 s]
[INFO] Keycloak SSSD Federation ........................... SUCCESS [  2.301 s]
[INFO] KeyCloak Authz: Parent ............................. SUCCESS [  0.083 s]
[INFO] KeyCloak AuthZ: Provider Parent .................... SUCCESS [  0.083 s]
[INFO] KeyCloak AuthZ: Common Policy Providers ............ SUCCESS [  0.584 s]
[INFO] Keycloak Dependencies Server All ................... SUCCESS [  0.083 s]
[INFO] Keycloak Federation ................................ SUCCESS [  0.067 s]
[INFO] Keycloak Util Embedded LDAP ........................ SUCCESS [  1.000 s]
[INFO] Keycloak Util Parent ............................... SUCCESS [  0.066 s]
[INFO] Keycloak WildFly Integration ....................... SUCCESS [  0.050 s]
[INFO] Keycloak WildFly Add User Script ................... SUCCESS [  1.100 s]
[INFO] Keycloak WildFly Extensions ........................ SUCCESS [  0.551 s]
[INFO] Keycloak WildFly Server Subsystem .................. SUCCESS [  1.999 s]
[INFO] Keycloak Integration ............................... SUCCESS [  0.067 s]
[INFO] Keycloak Admin REST Client ......................... SUCCESS [  0.783 s]
[INFO] Keycloak Client Registration API ................... SUCCESS [  0.267 s]
[INFO] Keycloak Client CLI ................................ SUCCESS [  0.066 s]
[INFO] Keycloak Client Registration CLI ................... SUCCESS [  3.067 s]
[INFO] Keycloak Admin CLI ................................. SUCCESS [  2.300 s]
[INFO] Keycloak Client CLI Distribution ................... SUCCESS [  1.250 s]
[INFO] Keycloak Adapter SPI ............................... SUCCESS [  0.517 s]
[INFO] Keycloak Tomcat Adapter SPI ........................ SUCCESS [  0.233 s]
[INFO] Keycloak Undertow Integration SPI .................. SUCCESS [  0.617 s]
[INFO] Keycloak Servlet Integration ....................... SUCCESS [  0.417 s]
[INFO] Common JBoss/Wildfly Core Classes .................. SUCCESS [  0.250 s]
[INFO] Keycloak Jetty Adapter SPI ......................... SUCCESS [  0.499 s]
[INFO] Keycloak Client Adapter SPI Modules ................ SUCCESS [  0.034 s]
[INFO] Keycloak SAML Client Adapter Public API ............ SUCCESS [  0.267 s]
[INFO] Keycloak SAML Client Adapter Core .................. SUCCESS [  0.883 s]
[INFO] Keycloak Undertow SAML Adapter ..................... SUCCESS [  0.417 s]
[INFO] Keycloak SAML Tomcat Integration ................... SUCCESS [  0.049 s]
[INFO] Keycloak Tomcat Core SAML Integration .............. SUCCESS [  0.284 s]
[INFO] Keycloak Tomcat SAML Integration ................... SUCCESS [  0.367 s]
[INFO] Keycloak Tomcat 7 SAML Integration ................. SUCCESS [  0.300 s]
[INFO] Keycloak Wildfly SAML Adapter ...................... SUCCESS [  0.383 s]
[INFO] KeyCloak Authz: Client API ......................... SUCCESS [  0.867 s]
[INFO] Keycloak Adapter Core .............................. SUCCESS [  1.700 s]
[INFO] Keycloak WildFly Elytron SAML Adapter .............. SUCCESS [  0.633 s]
[INFO] Keycloak Wildfly SAML Adapter Subsystem ............ SUCCESS [  1.000 s]
[INFO] Keycloak SAML Wildfly Integration .................. SUCCESS [  0.067 s]
[INFO] Keycloak SAML Servlet Filter ....................... SUCCESS [  0.466 s]
[INFO] Keycloak Jetty Core SAML Integration ............... SUCCESS [  0.867 s]
[INFO] Keycloak Jetty 9.2.x SAML Integration .............. SUCCESS [  0.817 s]
[INFO] Keycloak Jetty 9.3.x SAML Integration .............. SUCCESS [  0.883 s]
[INFO] Keycloak Jetty 9.4.x SAML Integration .............. SUCCESS [  0.766 s]
[INFO] Keycloak SAML Jetty Integration .................... SUCCESS [  0.051 s]
[INFO] Keycloak SAML Client Adapter Modules ............... SUCCESS [  0.067 s]
[INFO] Keycloak Installed Application ..................... SUCCESS [  0.300 s]
[INFO] Keycloak Undertow Integration ...................... SUCCESS [  0.800 s]
[INFO] Keycloak Fuse 7.0 Integration ...................... SUCCESS [  0.066 s]
[INFO] Keycloak Fuse 7.0 Adapter - Camel + Undertow ....... SUCCESS [  0.983 s]
[INFO] Keycloak OSGI Adapter .............................. SUCCESS [  0.933 s]
[INFO] Keycloak Fuse 7.0 Adapter - Undertow ............... SUCCESS [  0.950 s]
[INFO] Keycloak Jetty Core Integration .................... SUCCESS [  0.550 s]
[INFO] Keycloak Jetty 9.4.x Integration ................... SUCCESS [  0.450 s]
[INFO] Keycloak Fuse 7.0 Adapter - Jetty 9.4 .............. SUCCESS [  0.700 s]
[INFO] Keycloak Tomcat Integration ........................ SUCCESS [  0.050 s]
[INFO] Keycloak Tomcat Core Integration ................... SUCCESS [  0.367 s]
[INFO] Keycloak Tomcat Integration ........................ SUCCESS [  0.383 s]
[INFO] Keycloak Fuse 7.0 Adapter - Tomcat 8 ............... SUCCESS [  0.633 s]
[INFO] Keycloak CLI SSO Framework ......................... SUCCESS [  3.067 s]
[INFO] Keycloak JAX-RS OAuth Client ....................... SUCCESS [  0.334 s]
[INFO] Keycloak Jetty 9.2.x Integration ................... SUCCESS [  0.466 s]
[INFO] Keycloak Jetty 9.3.x Integration ................... SUCCESS [  0.517 s]
[INFO] Keycloak Jetty Integration ......................... SUCCESS [  0.083 s]
[INFO] Keycloak Servlet Filter Adapter Integration ........ SUCCESS [  0.467 s]
[INFO] spring-boot-container-bundle ....................... SUCCESS [  1.283 s]
[INFO] spring-boot-legacy-container-bundle ................ SUCCESS [  1.033 s]
[INFO] Keycloak Spring Security Integration ............... SUCCESS [  2.001 s]
[INFO] Keycloak Spring Boot Adapter Core .................. SUCCESS [  0.599 s]
[INFO] Keycloak Spring Boot Integration ................... SUCCESS [  0.350 s]
[INFO] Keycloak Spring Boot 2 Integration ................. SUCCESS [  0.684 s]
[INFO] Keycloak Tomcat 7 Integration ...................... SUCCESS [  0.283 s]
[INFO] Keycloak Wildfly Integration ....................... SUCCESS [  0.317 s]
[INFO] Keycloak Wildfly Elytron OIDC Adapter .............. SUCCESS [  0.700 s]
[INFO] Keycloak Wildfly Adapter Subsystem ................. SUCCESS [  0.900 s]
[INFO] Keycloak WildFly Integration ....................... SUCCESS [  0.067 s]
[INFO] Keycloak OIDC Client Adapter Modules ............... SUCCESS [  0.050 s]
[INFO] Keycloak Adapters .................................. SUCCESS [  0.050 s]
[INFO] Keycloak Misc ...................................... SUCCESS [  0.067 s]
[INFO] Keycloak :: Spring :: Boot ......................... SUCCESS [  0.065 s]
[INFO] Keycloak :: Spring :: Boot :: Default ::  Starter .. SUCCESS [  0.267 s]
[INFO] Keycloak :: Spring :: Boot ......................... SUCCESS [  0.084 s]
[INFO] Keycloak :: Legacy :: Spring :: Boot :: Default ::  Starter SUCCESS [  0.300 s]
[INFO] keycloak-test-helper ............................... SUCCESS [  0.550 s]
[INFO] Keycloak TestSuite ................................. SUCCESS [  0.082 s]
[INFO] DB Allocator Plugin ................................ SUCCESS [  2.318 s]
[INFO] Keycloak Arquillian Integration TestSuite .......... SUCCESS [  0.166 s]
[INFO] Test apps .......................................... SUCCESS [  0.051 s]
[INFO] Test apps distribution ............................. SUCCESS [  3.850 s]
[INFO] Keycloak Authz: PhotoZ  Test Parent ................ SUCCESS [  0.100 s]
[INFO] Keycloak Authz Test: Photoz RESTful API ............ SUCCESS [  1.666 s]
[INFO] Keycloak Authz Tests: Photoz HTML5 Client .......... SUCCESS [  0.901 s]
[INFO] Keycloak Authz Tests: Hello World Example .......... SUCCESS [  0.349 s]
[INFO] Keycloak Authz: Servlet Authorization Test ......... SUCCESS [  0.767 s]
[INFO] Keycloak Authz: Simple Servlet App with Policy Enforcer SUCCESS [  0.350 s]
[INFO] integration-arquillian-test-apps-servlets .......... SUCCESS [  0.567 s]
[INFO] Keycloak Test App Profile JEE ...................... SUCCESS [  0.467 s]
[INFO] integration-arquillian-test-apps-cors-parent ....... SUCCESS [  0.099 s]
[INFO] Angular Product Portal JS .......................... SUCCESS [  1.201 s]
[INFO] JAX-RS Database Service Using OAuth Bearer Tokens .. SUCCESS [  0.600 s]
[INFO] Fuse Test Applications ............................. SUCCESS [  0.083 s]
[INFO] Customer Portal - Secured in Karaf/Fuse ............ SUCCESS [  1.133 s]
[INFO] CXF JAXRS Example - Secured in Karaf/Fuse .......... SUCCESS [  1.167 s]
[INFO] CXF JAXRS Example - Secured in Karaf/Fuse 7 on Undertow SUCCESS [  0.966 s]
[INFO] CXF JAXWS Example - Secured in Karaf/Fuse .......... SUCCESS [  1.934 s]
[INFO] CXF JAXWS Example - Secured in Karaf/Fuse 7 on Undertow SUCCESS [  1.600 s]
[INFO] Product Portal - Secured in Karaf/Fuse ............. SUCCESS [  0.800 s]
[INFO] Product Portal - Secured in Karaf/Fuse 7 on Undertow SUCCESS [  0.817 s]
[INFO] Camel endpoint example - Secured in Karaf/Fuse ..... SUCCESS [  0.583 s]
[INFO] Camel endpoint example - Secured in Karaf/Fuse 7.0 on Undertow SUCCESS [  0.533 s]
[INFO] Keycloak Fuse Example - Features ................... SUCCESS [  0.400 s]
[INFO] Keycloak Examples - External Config ................ SUCCESS [  0.717 s]
[INFO] spring-boot-adapter-app ............................ SUCCESS [  0.933 s]
[INFO] Servers ............................................ SUCCESS [  0.084 s]
[INFO] Auth Server ........................................ SUCCESS [  0.066 s]
[INFO] Auth Server Services ............................... SUCCESS [  0.084 s]
[INFO] Auth Server Services - Testsuite Providers ......... SUCCESS [  2.500 s]
[INFO] Auth Server - JBoss ................................ SUCCESS [  0.083 s]
[INFO] Keycloak TestSuite Utils ........................... SUCCESS [  1.683 s]
[INFO] Test Util .......................................... SUCCESS [  1.234 s]
[INFO] Auth Server - Undertow ............................. SUCCESS [  1.533 s]
[INFO] App Server ......................................... SUCCESS [  0.050 s]
[INFO] App Server - SPI ................................... SUCCESS [  0.234 s]
[INFO] App Server - JBoss ................................. SUCCESS [  0.049 s]
[INFO] App Server - Karaf ................................. SUCCESS [  0.067 s]
[INFO] App Server - Tomcat ................................ SUCCESS [  0.050 s]
[INFO] App Server - Undertow .............................. SUCCESS [  0.567 s]
[INFO] App Server - Jetty Parent .......................... SUCCESS [  0.116 s]
[INFO] Cache Server ....................................... SUCCESS [  0.067 s]
[INFO] Cache Server - JBoss Family ........................ SUCCESS [  0.083 s]
[INFO] Tests .............................................. SUCCESS [  0.300 s]
[INFO] Base TestSuite ..................................... SUCCESS [ 26.984 s]
[INFO] Other Tests Modules ................................ SUCCESS [  0.067 s]
[INFO] Adapter Tests ...................................... SUCCESS [  0.083 s]
[INFO] Adapter Tests - JBoss .............................. SUCCESS [  0.083 s]
[INFO] Adapter Tests - Karaf .............................. SUCCESS [  0.084 s]
[INFO] Adapter Tests - WAS ................................ SUCCESS [  0.083 s]
[INFO] Adapter Tests - WLS ................................ SUCCESS [  0.100 s]
[INFO] SSSD tests ......................................... SUCCESS [  2.850 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:53 min
[INFO] Finished at: 2020-01-16T15:43:34-08:00
[INFO] ------------------------------------------------------------------------
1 Like