dasniko / testcontainers-keycloak

A Testcontainer implementation for Keycloak IAM & SSO.
Apache License 2.0
328 stars 51 forks source link

Support testing Keycloak extensions as provider modules #38

Closed sventorben closed 2 years ago

sventorben commented 2 years ago

When developing custom SPIs Keycloak does not pick them up when deploying them as an extension. SPIs can be deployed as provider modules instead. This commit adds support for testing extensions as provider modules.

See this test as an example.

It makes use of the providers deployment from the Keycloak subsystem:

$ docker run --rm --entrypoint=cat quay.io/keycloak/keycloak:15.0.2 /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml | grep -A 6 dom
ain:keycloak-server
        <subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
            <web-context>auth</web-context>
            <providers>
                <provider>
                    classpath:${jboss.home.dir}/providers/*       <!--- THIS -->
                </provider>
            </providers>

This is basically the same as adding a module as a provider (see documentation here), but simply adds the jar to the classpath instead of using a module.

dasniko commented 2 years ago

Released as version 1.8.1 (as of now, Maven Central still takes some time to update the index)