<div dir="ltr"><div>Hello</div><div><br></div><div><div>I&#39;ve been trying to get to work spring security with keycloak on widlfly for hours.</div></div><div><br></div><div>I follow the instructions as described here:  <a href="http://keycloak.github.io/docs/userguide/keycloak-server/html/ch08.html#spring-security-adapter">http://keycloak.github.io/docs/userguide/keycloak-server/html/ch08.html#spring-security-adapter</a>.</div><div><br></div><div>This is my environment:</div><div>- Wildfly 9 (not spring-boot)</div><div>- Keycloak 1.7</div><div>- keycloak-spring-security-adapter in webapplication</div><div>- keycloak.json in WEB-INF</div><div>- spring-security-xml configuration as described in 8.10.2.2.</div><div>- No security config in web.xml</div><div>- No keycloak adapter in wildfly</div><div><br></div><div>Application starts up fine, spring security configuration seems to be loaded. But when I directly access a protected resources, the resource is not protected and I can access it directly. I am not redirected to login on keycloak. So it seems spring security is not picking up the security rules...</div><div><br></div><div>When I do not use the keycloak-spring-security-adapter and do the security configuration in web.xml, it works. But then I&#39;m missing the integration with spring security, and thats what I need...</div><div><br></div><div>Any advice is more than welcomed...</div><div><br></div><div>Thanks, </div><div>Ben</div></div>