Repository: quarkusio/quarkus
Issue: DevServices for Keycloak UI is broken on 2.8-main

### Describe the bug

Regression has been introduced on `main`, after starting `mvn quarkus:dev` and going to `http://localhost:8080/q/dev/`, the OIDC card does not have a `Provider: Keycloak` link to `http://localhost:8080/q/dev/io.quarkus.quarkus-oidc/provider`. `http://localhost:8080/q/dev/io.quarkus.quarkus-oidc/provider` does respond if it is accessed directly but the UI is wrong there as well, `Service Path` field is shown alongside the expected `Log Into Single Page Application`.

It took me a long time to trace it down to #23781. All works as expected with the immediately preceding commit (Stork doc improvements).

The existing smoke test detects `http://localhost:8080/q/dev/io.quarkus.quarkus-oidc/provider` which is not sufficient, I think one of the OIDC devmode tests will need to be updated to check that `http://localhost:8080/q/dev` has a `Provider: Keycloak` string.

### Expected behavior

OIDC Card has a `Provider: Keycloak` and the provider page should only have a `Log Into Single Page Application` option, as shown [here](https://quarkus.io/guides/security-openid-connect-dev-services#dev-services-for-keycloak)

### Actual behavior

_No response_

### How to Reproduce?

Do `mvn quarkus:dev` in `quarkus-quickstarts/security-openid-connect-quickstart` and go to `http://localhost:8080/q/dev` and observe an empty OIDC card without `Provider: Keycloak`, then go to `http://localhost:8080/q/dev/io.quarkus.quarkus-oidc/provider` and see a redundant `Service Path` field 

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

_No response_

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

_No response_

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

_No response_

### Additional information

_No response_

Changed files:
extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java
extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesConfigBuildItem.java
extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevConsoleProcessor.java

diff --git a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevConsoleProcessor.java b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevConsoleProcessor.java
index bb080341ec9..16de5057247 100644
--- a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevConsoleProcessor.java
+++ b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevConsoleProcessor.java
@@ -31,20 +31,20 @@ public void setConfigProperties(BuildProducer<DevConsoleTemplateInfoBuildItem> d
             BuildProducer<DevConsoleRuntimeTemplateInfoBuildItem> devConsoleRuntimeInfo,
             Optional<KeycloakDevServicesConfigBuildItem> configProps,
             Capabilities capabilities, CurateOutcomeBuildItem curateOutcomeBuildItem) {
-        if (configProps.isPresent() && configProps.get().getProperties().containsKey("keycloak.url")) {
-            String keycloakUrl = (String) configProps.get().getProperties().get("keycloak.url");
-            String realmUrl = keycloakUrl + "/realms/" + configProps.get().getProperties().get("keycloak.realm");
-
-            devConsoleInfo.produce(new DevConsoleTemplateInfoBuildItem("keycloakAdminUrl", keycloakUrl));
+        if (configProps.isPresent() && configProps.get().getConfig().containsKey("keycloak.url")) {
+            devConsoleInfo.produce(
+                    new DevConsoleTemplateInfoBuildItem("keycloakAdminUrl", configProps.get().getConfig().get("keycloak.url")));
             devConsoleInfo.produce(
-                    new DevConsoleTemplateInfoBuildItem("keycloakUsers", configProps.get().getProperties().get("oidc.users")));
+                    new DevConsoleTemplateInfoBuildItem("keycloakUsers",
+                            configProps.get().getProperties().get("oidc.users")));
 
+            String realmUrl = configProps.get().getConfig().get("quarkus.oidc.auth-server-url");
             produceDevConsoleTemplateItems(capabilities,
                     devConsoleInfo,
                     devConsoleRuntimeInfo,
                     curateOutcomeBuildItem,
                     "Keycloak",
-                    (String) configProps.get().getProperties().get("quarkus.oidc.application-type"),
+                    (String) configProps.get().getConfig().get("quarkus.oidc.application-type"),
                     oidcConfig.devui.grant.type.isPresent() ? oidcConfig.devui.grant.type.get().getGrantType()
                             : keycloakConfig.devservices.grant.type.getGrantType(),
                     realmUrl + "/protocol/openid-connect/auth",
@@ -57,7 +57,7 @@ public void setConfigProperties(BuildProducer<DevConsoleTemplateInfoBuildItem> d
     @BuildStep(onlyIf = IsDevelopment.class)
     void invokeEndpoint(BuildProducer<DevConsoleRouteBuildItem> devConsoleRoute,
             Optional<KeycloakDevServicesConfigBuildItem> configProps) {
-        if (configProps.isPresent() && configProps.get().getProperties().containsKey("keycloak.url")) {
+        if (configProps.isPresent() && configProps.get().getConfig().containsKey("keycloak.url")) {
             @SuppressWarnings("unchecked")
             Map<String, String> users = (Map<String, String>) configProps.get().getProperties().get("oidc.users");
             Duration webClientTimeout = oidcConfig.devui.webClienTimeout.isPresent() ? oidcConfig.devui.webClienTimeout.get()
diff --git a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesConfigBuildItem.java b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesConfigBuildItem.java
index 371725dc2c7..83d5ed3d4d5 100644
--- a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesConfigBuildItem.java
+++ b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesConfigBuildItem.java
@@ -6,13 +6,19 @@
 
 public final class KeycloakDevServicesConfigBuildItem extends SimpleBuildItem {
 
+    private final Map<String, String> config;
     private final Map<String, Object> properties;
 
-    public KeycloakDevServicesConfigBuildItem(Map<String, Object> configProperties) {
+    public KeycloakDevServicesConfigBuildItem(Map<String, String> config, Map<String, Object> configProperties) {
+        this.config = config;
         this.properties = configProperties;
     }
 
     public Map<String, Object> getProperties() {
         return properties;
     }
+
+    public Map<String, String> getConfig() {
+        return config;
+    }
 }
diff --git a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java
index dcc9d6a47a4..5aa660ab496 100644
--- a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java
+++ b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java
@@ -37,9 +37,9 @@
 import org.testcontainers.containers.wait.strategy.Wait;
 import org.testcontainers.utility.DockerImageName;
 
-import io.quarkus.deployment.Feature;
 import io.quarkus.deployment.IsDockerWorking;
 import io.quarkus.deployment.IsNormal;
+import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.CuratedApplicationShutdownBuildItem;
 import io.quarkus.deployment.builditem.DevServicesResultBuildItem;
@@ -78,8 +78,8 @@ public class KeycloakDevServicesProcessor {
     private static final String CLIENT_ID_CONFIG_KEY = CONFIG_PREFIX + "client-id";
     private static final String CLIENT_SECRET_CONFIG_KEY = CONFIG_PREFIX + "credentials.secret";
     private static final String KEYCLOAK_URL_KEY = "keycloak.url";
-    private static final String KEYCLOAK_REALM_KEY = "keycloak.realm";
 
+    private static final String KEYCLOAK_CONTAINER_NAME = "keycloak";
     private static final int KEYCLOAK_PORT = 8080;
 
     private static final String KEYCLOAK_LEGACY_IMAGE_VERSION_PART = "-legacy";
@@ -121,6 +121,7 @@ public class KeycloakDevServicesProcessor {
 
     @BuildStep(onlyIfNot = IsNormal.class, onlyIf = { IsEnabled.class, GlobalDevServicesConfig.Enabled.class })
     public DevServicesResultBuildItem startKeycloakContainer(
+            BuildProducer<KeycloakDevServicesConfigBuildItem> keycloakBuildItemBuildProducer,
             List<DevServicesSharedNetworkBuildItem> devServicesSharedNetworkBuildItem,
             Optional<OidcDevServicesBuildItem> oidcProviderBuildItem,
             KeycloakBuildTimeConfig config,
@@ -168,7 +169,8 @@ public DevServicesResultBuildItem startKeycloakContainer(
             vertxInstance = Vertx.vertx();
         }
         try {
-            RunningDevService newDevService = startContainer(!devServicesSharedNetworkBuildItem.isEmpty(),
+            RunningDevService newDevService = startContainer(keycloakBuildItemBuildProducer,
+                    !devServicesSharedNetworkBuildItem.isEmpty(),
                     devServicesConfig.timeout);
             if (newDevService == null) {
                 compressor.close();
@@ -221,7 +223,9 @@ private String startURL(String host, Integer port, boolean isKeyCloakX) {
         return "http://" + host + ":" + port + (isKeyCloakX ? "" : "/auth");
     }
 
-    private Map<String, String> prepareConfiguration(String internalURL, String hostURL, RealmRepresentation realmRep,
+    private Map<String, String> prepareConfiguration(
+            BuildProducer<KeycloakDevServicesConfigBuildItem> keycloakBuildItemBuildProducer, String internalURL,
+            String hostURL, RealmRepresentation realmRep,
             boolean keycloakX) {
         final String realmName = realmRep != null ? realmRep.getRealm() : getDefaultRealmName();
         final String authServerInternalUrl = realmsURL(internalURL, realmName);
@@ -249,6 +253,10 @@ private Map<String, String> prepareConfiguration(String internalURL, String host
         configProperties.put(APPLICATION_TYPE_CONFIG_KEY, oidcApplicationType);
         configProperties.put(CLIENT_ID_CONFIG_KEY, oidcClientId);
         configProperties.put(CLIENT_SECRET_CONFIG_KEY, oidcClientSecret);
+
+        keycloakBuildItemBuildProducer
+                .produce(new KeycloakDevServicesConfigBuildItem(configProperties, Map.of(OIDC_USERS, users)));
+
         return configProperties;
     }
 
@@ -260,7 +268,8 @@ private String getDefaultRealmName() {
         return capturedDevServicesConfiguration.realmName.orElse("quarkus");
     }
 
-    private RunningDevService startContainer(boolean useSharedNetwork, Optional<Duration> timeout) {
+    private RunningDevService startContainer(BuildProducer<KeycloakDevServicesConfigBuildItem> keycloakBuildItemBuildProducer,
+            boolean useSharedNetwork, Optional<Duration> timeout) {
         if (!capturedDevServicesConfiguration.enabled) {
             // explicitly disabled
             LOG.debug("Not starting Dev Services for Keycloak as it has been disabled in the config");
@@ -305,19 +314,21 @@ private RunningDevService startContainer(boolean useSharedNetwork, Optional<Dura
             String hostUrl = oidcContainer.useSharedNetwork
                     ? startURL("localhost", oidcContainer.fixedExposedPort.getAsInt(), oidcContainer.keycloakX)
                     : null;
-            Map<String, String> configs = prepareConfiguration(internalUrl, hostUrl, oidcContainer.realmRep,
+
+            Map<String, String> configs = prepareConfiguration(keycloakBuildItemBuildProducer, internalUrl, hostUrl,
+                    oidcContainer.realmRep,
                     oidcContainer.keycloakX);
-            return new RunningDevService(Feature.KEYCLOAK_AUTHORIZATION.getName(), oidcContainer.getContainerId(),
+            return new RunningDevService(KEYCLOAK_CONTAINER_NAME, oidcContainer.getContainerId(),
                     oidcContainer::close, configs);
         };
 
         return maybeContainerAddress
                 .map(containerAddress -> {
                     // TODO: this probably needs to be addressed
-                    Map<String, String> configs = prepareConfiguration(getSharedContainerUrl(containerAddress),
+                    Map<String, String> configs = prepareConfiguration(keycloakBuildItemBuildProducer,
+                            getSharedContainerUrl(containerAddress),
                             getSharedContainerUrl(containerAddress), null, false);
-                    return new RunningDevService(Feature.KEYCLOAK_AUTHORIZATION.getName(),
-                            containerAddress.getId(), null, configs);
+                    return new RunningDevService(KEYCLOAK_CONTAINER_NAME, containerAddress.getId(), null, configs);
                 })
                 .orElseGet(defaultKeycloakContainerSupplier);
     }