Class PolicyEnforcerServletContextListener

java.lang.Object
org.keycloak.adapters.authorization.integration.elytron.PolicyEnforcerServletContextListener
All Implemented Interfaces:
jakarta.servlet.ServletContextListener, EventListener

@WebListener public class PolicyEnforcerServletContextListener extends Object implements jakarta.servlet.ServletContextListener
A ServletContextListener to programmatically configure the ServletContext in order to enable the policy enforcer.

By default, the policy enforcer configuration is loaded from a file at WEB-INF/policy-enforcer.json.

Applications can also dynamically resolve the configuration by implementing the ConfigurationResolver SPI. For that, make sure to create a {@link META-INF/services/org.keycloak.adapters.authorization.spi.ConfigurationResolver} to register the implementation.
Author:
Pedro Igor
  • Constructor Details

    • PolicyEnforcerServletContextListener

      public PolicyEnforcerServletContextListener()
  • Method Details

    • contextInitialized

      public void contextInitialized(jakarta.servlet.ServletContextEvent sce)
      Specified by:
      contextInitialized in interface jakarta.servlet.ServletContextListener