Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Both authenticationEnabled and keycloakEnabled to false should disable Keycloak and authentication together on Spring Boot #2924

Open
tadayosi opened this issue Aug 24, 2023 · 1 comment

Comments

@tadayosi
Copy link
Member

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>
@mmuzikar
Copy link
Contributor

mmuzikar commented Aug 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants