keycloak

Springboot testing with keycloak

ぐ巨炮叔叔 提交于 2020-08-27 07:49:17
问题 I'm trying to run simple unit test, Keycloak is configured in proper way( I tested it and my mvc app is connecting and users are authenticated_ but now I tried to test my controllers and even though I used spring slices keycloak adapter is invoked and giving me errors. Adapter configuration is mostly brought from keycloak documentation @WebMvcTest(UserController.class) class UserControllerTest { @MockBean UserService userService; @Autowired MockMvc mockMvc; @BeforeEach void setUp() { }

Keycloak 9.0.2 : missing script mapper

青春壹個敷衍的年華 提交于 2020-08-26 04:03:42
问题 with keycloak 9.0.2, we have to use a script mapper in a client to add specific claims from header request, but script mapper is missing in mapper type. Here an extract of our docker-compose file : version: '3.4' services: keycloak: image: jboss/keycloak:latest command: - "-b 0.0.0.0" - "-Djboss.socket.binding.port-offset=1000" - "-Dkeycloak.profile.feature.scripts=enabled" env_file: - ./keycloak.env ports: - 9080:9080 - 9443:9443 - 10990:10990 In logs, we see the line at startup : 09:31:55