Could anyone done the advance keycloak RBAC with Spring boot webflux reactive application.
Role, scope, policy and permition base API authorization with keycloak
Currently in spring boot web application we can use keycloak-policy-enforcer dependancy and use the following code.
private ServletPolicyEnforcerFilter createPolicyEnforcerFilter() {
return new ServletPolicyEnforcerFilter(new ConfigurationResolver() {
@Override
public PolicyEnforcerConfig resolve(HttpRequest request) {
try {
return JsonSerialization.
readValue(getClass().getResourceAsStream("/policy-enforcer.json"),
PolicyEnforcerConfig.class);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
});
}
How we can do the same thing with spring boot webflux