Class 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 Detail

      • PolicyEnforcerServletContextListener

        public PolicyEnforcerServletContextListener()
    • Method Detail

      • contextInitialized

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