Package io.quarkus.devservices.keycloak
Interface KeycloakDevServicesConfig
@ConfigMapping(prefix="quarkus.keycloak.devservices")
@ConfigRoot
public interface KeycloakDevServicesConfig
Build time configuration for the Keycloak Dev Service.
-
Method Summary
Modifier and TypeMethodDescriptionEnvironment variables to be passed to the container.io.quarkus.runtime.configuration.MemorySizeMemory limit for Keycloak container, up toLong.MAX_VALUEbytes.booleanSpecifies whether to create the default client id `quarkus-app` with a secret `secret` and register them if thecreateRealm()property is set to true.booleanSpecifies whether to create the Keycloak realm when no realm file is found at the `realm-path`.booleanenabled()Flag to enable (default) or disable Dev Services.features()Keycloak features.The container image name for Dev Services providers.javaOpts()The `JAVA_OPTS` passed to the keycloak JVMIndicates if a Keycloak-X image is used.port()The specific port for the dev service to listen on.The name of the Keycloak realm.A comma-separated list of class or file system paths to Keycloak realm files.Aliases to additional class or file system resources that are used to initialize Keycloak.Additional class or file system resources that are used to initialize Keycloak.roles()A map of roles for Keycloak users.The value of the `quarkus-dev-service-keycloak` label for identifying the Keycloak container.booleanshared()Determines if the Keycloak container is shared.booleanshowLogs()Show Keycloak log messages with a "Keycloak:" prefix.Keycloak start command.booleanSpecifies whether to start the container even if the default OIDC tenant is disabled.users()A map of Keycloak usernames to passwords.The WebClient timeout.
-
Method Details
-
enabled
@WithDefault("true") boolean enabled()Flag to enable (default) or disable Dev Services. When enabled, Dev Services for Keycloak automatically configures and starts Keycloak in Dev or Test mode, and when Docker is running. -
imageName
The container image name for Dev Services providers. Defaults to a Quarkus-based Keycloak image. For a WildFly-based distribution, use an image like `quay.io/keycloak/keycloak:19.0.3-legacy`. Keycloak Quarkus and WildFly images are initialized differently. Dev Services for Keycloak will assume it is a Keycloak Quarkus image unless the image version ends with `-legacy`. Override with `quarkus.keycloak.devservices.keycloak-x-image`. -
keycloakXImage
Indicates if a Keycloak-X image is used. By default, the image is identified by `keycloak-x` in the image name. For custom images, override with `quarkus.keycloak.devservices.keycloak-x-image`. You do not need to set this property if the default check works. -
serviceName
The value of the `quarkus-dev-service-keycloak` label for identifying the Keycloak container. Used in shared mode to locate an existing container with this label. If not found, a new container is initialized with this label. Applicable only in dev mode. -
realmPath
A comma-separated list of class or file system paths to Keycloak realm files. This list is used to initialize Keycloak. The first value in this list is used to initialize default tenant connection properties.To learn more about Keycloak realm files, consult the Importing and Exporting Keycloak Realms documentation.
-
resourceAliases
Aliases to additional class or file system resources that are used to initialize Keycloak. Each map entry represents a mapping between an alias and a class or file system resource path. -
resourceMappings
Additional class or file system resources that are used to initialize Keycloak. Each map entry represents a mapping between a class or file system resource path alias and the Keycloak container location. -
javaOpts
The `JAVA_OPTS` passed to the keycloak JVM -
showLogs
@WithDefault("false") boolean showLogs()Show Keycloak log messages with a "Keycloak:" prefix. -
startCommand
Keycloak start command. Use this property to experiment with Keycloak start options, see}. Note, it is ignored when loading legacy Keycloak WildFly images.invalid @link
{@link https://www.keycloak.org/server/all-config -
features
Keycloak features. Use this property to enable one or more experimental Keycloak features. Note, if you also have to customize a KeycloakstartCommand(), you can use a `--features` option as part of the start command sequence, instead of configuring this property. -
realmName
The name of the Keycloak realm. This property is used to create the realm if the realm file pointed to by the `realm-path` property does not exist. The default value is `quarkus` in this case. It is recommended to always set this property so that Dev Services for Keycloak can identify the realm name without parsing the realm file. -
createRealm
@WithDefault("true") boolean createRealm()Specifies whether to create the Keycloak realm when no realm file is found at the `realm-path`. Set to `false` if the realm is to be created using either the Keycloak Administration Console or the Keycloak Admin API provided by.invalid reference
io.quarkus.test.common.QuarkusTestResourceLifecycleManager
-
createClient
@WithDefault("true") boolean createClient()Specifies whether to create the default client id `quarkus-app` with a secret `secret` and register them if thecreateRealm()property is set to true. For OIDC extension configuration properties `quarkus.oidc.client.id` and `quarkus.oidc.credentials.secret` will be configured. For OIDC Client extension configuration properties `quarkus.oidc-client.client.id` and `quarkus.oidc-client.credentials.secret` will be configured. Set to `false` if clients have to be created using either the Keycloak Administration Console or the Keycloak Admin API provided byor registered dynamically.invalid reference
io.quarkus.test.common.QuarkusTestResourceLifecycleManager
-
startWithDisabledTenant
@WithDefault("false") boolean startWithDisabledTenant()Specifies whether to start the container even if the default OIDC tenant is disabled. Setting this property to true may be necessary in a multi-tenant OIDC setup, especially when OIDC tenants are created dynamically. -
users
A map of Keycloak usernames to passwords. If empty, default users `alice` and `bob` are created with their names as passwords. This map is used for user creation when no realm file is found at the `realm-path`. -
roles
A map of roles for Keycloak users. If empty, default roles are assigned: `alice` receives `admin` and `user` roles, while other users receive `user` role. This map is used for role creation when no realm file is found at the `realm-path`. -
port
OptionalInt port()The specific port for the dev service to listen on.If not specified, a random port is selected.
-
containerEnv
Environment variables to be passed to the container. -
containerMemoryLimit
@WithDefault("1250M") io.quarkus.runtime.configuration.MemorySize containerMemoryLimit()Memory limit for Keycloak container, up toLong.MAX_VALUEbytes. If not specified, 1250MiB is the default memory limit. -
webClientTimeout
The WebClient timeout. Use this property to configure how long an HTTP client used by OIDC dev service admin client will wait for a response from OpenId Connect Provider when acquiring admin token and creating realm.
-