|
|
|
@ -21,10 +21,10 @@ public class KeyCloakHealthCheck implements HealthCheck{
|
|
|
|
|
try {
|
|
|
|
|
Set<String> contexts = ProviderFactory.provider().containerContext().authorizationProvider().getContexts();
|
|
|
|
|
if (contexts.isEmpty())
|
|
|
|
|
return HealthCheckResponse.builder(CHECK_NAME).down().withMessage("no contexts are defined for the client id provided").build();
|
|
|
|
|
return HealthCheckResponse.builder(CHECK_NAME).up().build();
|
|
|
|
|
return HealthCheckResponse.builder(CHECK_NAME).down().error("no contexts are defined for the client id provided").build();
|
|
|
|
|
return HealthCheckResponse.builder(CHECK_NAME).up().info(String.format("running contexts are %s", contexts)).build();
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
return HealthCheckResponse.builder(CHECK_NAME).down().withMessage(e.getMessage()).build();
|
|
|
|
|
return HealthCheckResponse.builder(CHECK_NAME).down().error(e.getMessage()).build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|