From f37e1b6871a0800fb1a46dff7c09282abf64c49f Mon Sep 17 00:00:00 2001 From: Sergey Beryozkin Date: Mon, 2 Sep 2024 13:42:22 +0100 Subject: [PATCH] Fix Keycloak Dev service to allocate default client id and secret --- .../devservices/keycloak/KeycloakDevServicesProcessor.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 3296c8295661c..1bd7965cbf692 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 @@ -853,16 +853,14 @@ private static String getOidcApplicationType() { } private static String getOidcClientId() { - boolean isService = "service".equals(getOidcApplicationType()); // if the application type is web-app or hybrid, OidcRecorder will enforce that the client id and secret are configured return ConfigProvider.getConfig().getOptionalValue(CLIENT_ID_CONFIG_KEY, String.class) - .orElse(!isService ? "quarkus-app" : ""); + .orElse(capturedDevServicesConfiguration.createClient ? "quarkus-app" : ""); } private static String getOidcClientSecret() { - boolean isService = "service".equals(getOidcApplicationType()); // if the application type is web-app or hybrid, OidcRecorder will enforce that the client id and secret are configured return ConfigProvider.getConfig().getOptionalValue(CLIENT_SECRET_CONFIG_KEY, String.class) - .orElse(!isService ? "secret" : ""); + .orElse(capturedDevServicesConfiguration.createClient ? "secret" : ""); } }