Class Pac4jBundle<T extends io.dropwizard.core.Configuration>

java.lang.Object
org.pac4j.dropwizard.Pac4jBundle<T>
All Implemented Interfaces:
io.dropwizard.core.ConfiguredBundle<T>, Pac4jConfiguration<T>

public abstract class Pac4jBundle<T extends io.dropwizard.core.Configuration> extends Object implements io.dropwizard.core.ConfiguredBundle<T>, Pac4jConfiguration<T>
A ConfiguredBundle which sets up Pac4JSecurityFeature, Pac4JValueFactoryProvider as well as installs SecurityFilters into a Dropwizard application's Jersey filter chain.
Since:
1.0.0
Author:
Evan Meagher, Victor Noel - Linagora
  • Constructor Details

    • Pac4jBundle

      public Pac4jBundle()
  • Method Details

    • initialize

      public final void initialize(io.dropwizard.core.setup.Bootstrap<?> bootstrap)
      Specified by:
      initialize in interface io.dropwizard.core.ConfiguredBundle<T extends io.dropwizard.core.Configuration>
    • supportedFeatures

      protected Collection<Pac4jFeatureSupport> supportedFeatures()
      In case of override, do not forget to call super.supportedFeatures() to get the default features, or to redefine them instead!
      Returns:
      the features to support for configuration parsing
      See Also:
    • run

      public final void run(T configuration, io.dropwizard.core.setup.Environment environment) throws Exception
      Specified by:
      run in interface io.dropwizard.core.ConfiguredBundle<T extends io.dropwizard.core.Configuration>
      Throws:
      Exception
    • setupJettySession

      protected void setupJettySession(io.dropwizard.core.setup.Environment environment)
      Override if needed, but prefer to exploit Pac4jFactory.setSessionEnabled(boolean) first.
      Parameters:
      environment - the dropwizard Environment
      Since:
      1.1.0
    • getConfig

      public org.pac4j.core.config.Config getConfig()
      To be used only after this bundle has been run (i.e., in the Application.run(Configuration, Environment) method.
      Returns:
      the Config built during run(Configuration, Environment) execution.