You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @dasniko ,
I am implementing a custom provider for keycloak 21.1.1. This provider to work need jdbc url and needs to be as environment variable into the realm.json file. Also, the provider has some dependencies on external libraries that i have embedded in the fat jar via shadowjar.
I am using testcontainers for keycloak 2.5.0. Currently the testcontainer is not started
The corresponding code is:
KeycloakContainer keycloak = new KeycloakContainer("quay.io/keycloak/keycloak:21.1.1")
.withEnv("JDBC_URL", dbContainer.getJdbcUrl())
.withProviderLibsFrom(dependencies)
.withRealmImportFile("keycloak/my-realm.json")
.withProviderClassesFrom("target/test-classes");
Questions:
In order to properly test the custom provider should i place the fat jar produced by the code under the test/resources/keycloak/provider-binaries or only the dependency jars? I properly set the factory for custom provider under the test/resources/keycloak/services.
If i put as environment variable JDBC_URL and use this variable ${JDBC_URL} into the json file, is it properly configured? Because i have read that only on the start of the container can be read a variable like ${JDBC_URL} from the realm json file.
How can i confirm that my custom provider is successfully loaded from the imported realm?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi @dasniko ,
I am implementing a custom provider for keycloak 21.1.1. This provider to work need jdbc url and needs to be as environment variable into the realm.json file. Also, the provider has some dependencies on external libraries that i have embedded in the fat jar via shadowjar.
I am using testcontainers for keycloak 2.5.0. Currently the testcontainer is not started
The corresponding code is:
KeycloakContainer keycloak = new KeycloakContainer("quay.io/keycloak/keycloak:21.1.1")
.withEnv("JDBC_URL", dbContainer.getJdbcUrl())
.withProviderLibsFrom(dependencies)
.withRealmImportFile("keycloak/my-realm.json")
.withProviderClassesFrom("target/test-classes");
Questions:
Thank you in advanced.
Beta Was this translation helpful? Give feedback.
All reactions