Class RolesDeclarationInitializer

  • All Implemented Interfaces:
    jakarta.servlet.ServletContextListener, EventListener

    public class RolesDeclarationInitializer
    extends Object
    implements jakarta.servlet.ServletContextListener
    This servlet container initializer checks if CDI is active and if so obtains the JWT CDI extension to fetch the collected roles from, which are then declared to the Servlet container.

    Declaring roles is a requirement of Java EE and Payara specifically enforces this. I.e. roles that aren't declared don't work.

    Author:
    Arjan Tijms
    • Constructor Detail

      • RolesDeclarationInitializer

        public RolesDeclarationInitializer()
    • Method Detail

      • contextInitialized

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