diff --git a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/DevUiConfig.java b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/DevUiConfig.java index d39cb8bdfd4713..2c5bd13435d02e 100644 --- a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/DevUiConfig.java +++ b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/DevUiConfig.java @@ -70,6 +70,7 @@ public String getGrantType() { * The WebClient timeout. * Use this property to configure how long an HTTP client used by Dev UI handlers will wait for a response when requesting * tokens from OpenId Connect Provider and sending them to the service endpoint. + * This timeout is also used by the OIDC dev service admin client. */ @ConfigItem(defaultValue = "4S") public Duration webClientTimeout; 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 30c8f2f724f90a..c7cc0247cd670b 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 @@ -28,6 +28,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +import io.smallrye.mutiny.TimeoutException; import org.eclipse.microprofile.config.ConfigProvider; import org.jboss.logging.Logger; import org.keycloak.representations.idm.ClientRepresentation; @@ -626,8 +627,11 @@ private String getAdminToken(WebClient client, String keycloakUrl) { keycloakUrl + "/realms/master/protocol/openid-connect/token", "admin-cli", null, "admin", "admin", null) .await().atMost(oidcConfig.devui.webClientTimeout); + } catch (TimeoutException e) { + LOG.error("Admin token can not be acquired due to a client connection timeout. " + + "You may try increasing the `quarkus.oidc.devui.web-client-timeout` property."); } catch (Throwable t) { - LOG.errorf("Admin token can not be acquired: %s", t.getMessage()); + LOG.error("Admin token can not be acquired", t); } return null; } @@ -673,7 +677,7 @@ private void createRealm(WebClient client, String token, String keycloakUrl, Rea } catch (Throwable t) { errors.add(String.format("Realm %s can not be created: %s", realm.getRealm(), t.getMessage())); - LOG.errorf("Realm %s can not be created: %s", realm.getRealm(), t.getMessage()); + LOG.errorf(t, "Realm %s can not be created", realm.getRealm()); } }