Class DevServicesConfig

java.lang.Object
io.quarkus.oidc.deployment.devservices.keycloak.DevServicesConfig

public class DevServicesConfig extends Object
  • Field Details

    • enabled

      @ConfigItem(defaultValue="true") public 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

      @ConfigItem(defaultValue="quay.io/keycloak/keycloak:25.0.6") public String 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

      @ConfigItem public Optional<Boolean> 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.
    • shared

      @ConfigItem(defaultValue="true") public boolean shared
      Determines if the Keycloak container is shared. When shared, Quarkus uses label-based service discovery to find and reuse a running Keycloak container, so a second one is not started. Otherwise, if a matching container is not is found, a new container is started. The service discovery uses the quarkus-dev-service-label label, whose value is set by the service-name property. Container sharing is available only in dev mode.
    • serviceName

      @ConfigItem(defaultValue="quarkus") public String 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

      @ConfigItem public Optional<List<String>> 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.
    • resourceAliases

      @ConfigItem @ConfigDocMapKey("alias-name") public Map<String,String> 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

      @ConfigItem @ConfigDocMapKey("resource-name") public Map<String,String> 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

      @ConfigItem public Optional<String> javaOpts
      The `JAVA_OPTS` passed to the keycloak JVM
    • showLogs

      @ConfigItem(defaultValue="false") public boolean showLogs
      Show Keycloak log messages with a "Keycloak:" prefix.
    • startCommand

      @ConfigItem public Optional<String> startCommand
      Keycloak start command. Use this property to experiment with Keycloak start options, see
      invalid @link
      {@link https://www.keycloak.org/server/all-config
      }. Note, it is ignored when loading legacy Keycloak WildFly images.
    • realmName

      @ConfigItem public Optional<String> 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

      @ConfigItem(defaultValue="true") public 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
      .
    • users

      @ConfigItem public Map<String,String> 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

      @ConfigItem @ConfigDocMapKey("role-name") public Map<String,List<String>> 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`.
    • grant

      Deprecated.
      This field is deprecated. Use DevUiConfig.grant instead.
      Specifies the grant type.
    • port

      @ConfigItem public OptionalInt port
      The specific port for the dev service to listen on.

      If not specified, a random port is selected.

    • containerEnv

      @ConfigItem @ConfigDocMapKey("environment-variable-name") public Map<String,String> containerEnv
      Environment variables to be passed to the container.
    • containerMemoryLimit

      @ConfigItem(defaultValue="750M") public io.quarkus.runtime.configuration.MemorySize containerMemoryLimit
      Memory limit for Keycloak container

      If not specified, 750MiB is the default memory limit.
  • Constructor Details

    • DevServicesConfig

      public DevServicesConfig()
  • Method Details