Unable to use Keycloak in Spring Boot 2.1 due to duplicated Bean Registration httpSessionManager

This helped me to resolve an issue, remove @KeycloakConfiguration and use this instead (from KEYCLOAK-8725): Java: @Configuration @ComponentScan( basePackageClasses = KeycloakSecurityComponents.class, excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = “org.keycloak.adapters.springsecurity.management.HttpSessionManager”)) @EnableWebSecurity Kotlin: @Configuration @ComponentScan( basePackageClasses = [KeycloakSecurityComponents::class], excludeFilters = [ComponentScan.Filter(type = FilterType.REGEX, pattern = [“org.keycloak.adapters.springsecurity.management.HttpSessionManager”])] ) @EnableWebSecurity

Enabling remote access to Keycloak

The standalone Keycloak server runs on the top of a JBoss Wildfly instance and this server doesn’t allow accessing it externally by default, for security reasons (it should be only for the administration console, but seems to affect every url in case of Keycloak). It has to be booted with the -b=0.0.0.0 option to enable … Read more

“HTTPS required” while logging in to Keycloak as admin

I was running the key cloak inside a docker container, The keycloak command line tool was avaialble inside the keycloak container. docker exec -it {contaierID} bash cd keycloak/bin ./kcadm.sh config credentials –server http://localhost:8080/auth –realm master –user admin ./kcadm.sh update realms/master -s sslRequired=NONE If the admin user is not created, then the user can be created … Read more

Configure reverse-proxy for Keycloak docker with custom base URL

Just tested that @home, and actually multiple configuration additions are needed: 1/ Run the keycloak container with env -e PROXY_ADDRESS_FORWARDING=true as explained in the docs, this is required in a proxy way of accessing to keycloak: docker run -it –rm -p 8087:8080 –name keycloak -e PROXY_ADDRESS_FORWARDING=true jboss/keycloak:latest Also explained in this SO question 2/ Change … Read more

Keycloak Docker HTTPS required

Update Feb 2022: Keycloak 17+ (e.g. quay.io/keycloak/keycloak:17.0.0) doesn’t support autogeneration of selfsigned cert. Minimal HTTPS working example for Keycloak 17+: 1.) Generate selfsigned domain cert/key (follow instructions on your terminal): openssl req -newkey rsa:2048 -nodes \ -keyout server.key.pem -x509 -days 3650 -out server.crt.pem 2.) Update permissions for the key chmod 755 server.key.pem 3.) Start Keycloak … Read more