Skip to content

Commit

Permalink
Merge pull request quarkusio#42947 from sberyozkin/fix_oidc_devservic…
Browse files Browse the repository at this point in the history
…e_oidc_client_allocation

Fix Keycloak Dev service to allocate default client id and secret
  • Loading branch information
sberyozkin authored Sep 2, 2024
2 parents 8620343 + f37e1b6 commit dcd9928
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 dcd9928

Please sign in to comment.