I’m currently working on a Spring Boot WebFlux application and would like to integrate Keycloak Policy Enforcer to enforce authorization policies defined in Keycloak.
Keycloak’s documentation provides clear support for Servlet-based applications (Spring MVC), but I haven’t found any official guidance for WebFlux. Since WebFlux is reactive and uses ServerHttpSecurity instead of HttpSecurity, the ServletPolicyEnforcerFilter doesn’t seem to work here.
Is there any way to integrate Keycloak Policy Enforcer with Spring Boot WebFlux? If not, what would be the recommended approach to enforce authorization policies (e.g., role-based or resource-based access control) in a WebFlux application using Keycloak?
Any examples or insights on how to achieve this would be greatly appreciated!
1