Skip to content

Commit

Permalink
Fix Keycloak Dev service to allocate default client id and secret
Browse files Browse the repository at this point in the history
  • Loading branch information
sberyozkin committed Sep 2, 2024
1 parent 644cc9c commit f37e1b6
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" : "");
}
}

0 comments on commit f37e1b6

Please sign in to comment.