hawtio
hawtio copied to clipboard
Both `authenticationEnabled` and `keycloakEnabled` to `false` should disable Keycloak and authentication together on Spring Boot
Right now, even if you apply the following config to application.properties
in a Spring Boot application, the app is still configured to integrate with Keycloak and tries to dispatch authentication to Keycloak:
hawtio.authenticationEnabled = false
hawtio.keycloakEnabled = false
To disable keycloak integration with Spring Boot, you need to comment out this dependency:
<dependency>
<groupId>io.hawt</groupId>
<artifactId>hawtio-springboot-keycloak</artifactId>
</dependency>
A temporary workaround to disable spring security in the tests I found is
@Bean
WebSecurityCustomizer webSecurityCustomizer() {
if (activeProfiles.contains("keycloak")) {
return (web) -> {};
} else {
return (web) -> web.ignoring().anyRequest();
}
}
This way auth is still handled by hawtio auth and if the keycloak profile is used then the springboot-keycloak autoconfiguration is used.