Class JaspiConfigurationBuilder

java.lang.Object
org.wildfly.security.auth.jaspi.JaspiConfigurationBuilder

public final class JaspiConfigurationBuilder extends Object
A builder API to assemble JASPIC configuration.
Author:
Darran Lofthouse
  • Method Details

    • setDescription

      public JaspiConfigurationBuilder setDescription(String description)
      Set the description to be used for the provider once registered.
      Parameters:
      description - the description to be used for the provider once registered.
      Returns:
      this JaspiConfigurationBuilder to allow chaining of commands.
      Throws:
      IllegalStateException - if the configuration has already been registered.
    • addAuthModuleFactory

      public JaspiConfigurationBuilder addAuthModuleFactory(Supplier<jakarta.security.auth.message.module.ServerAuthModule> serverAuthModuleFactory)
      Add a Supplier<jakarta.security.auth.message.module.ServerAuthModule> to be used to create a ServerAuthModule instance for this message layer and application context combination.
      Parameters:
      serverAuthModuleFactory - the Supplier<jakarta.security.auth.message.module.ServerAuthModule> to be added to the list of module factories.
      Returns:
      this JaspiConfigurationBuilder to allow chaining of commands.
      Throws:
      IllegalStateException - if the configuration has already been registered.
    • addAuthModuleFactory

      public JaspiConfigurationBuilder addAuthModuleFactory(Supplier<jakarta.security.auth.message.module.ServerAuthModule> serverAuthModuleFactory, Flag flag, Map options)
      Add a Supplier<jakarta.security.auth.message.module.ServerAuthModule> to be used to create a ServerAuthModule instance for this message layer and application context combination.
      Parameters:
      serverAuthModuleFactory - the Supplier<jakarta.security.auth.message.module.ServerAuthModule> to be added to the list of module factories.
      flag - the flag to control the handling of the auth module.
      options - the configuration options to pass to the module during initialisation.
      Returns:
      this JaspiConfigurationBuilder to allow chaining of commands.
      Throws:
      IllegalStateException - if the configuration has already been registered.
    • register

      public String register()
      Register the assembled configuration against the system wide AuthConfigFactory.
      Returns:
      The registration ID returned by the factory on registration.
      Throws:
      IllegalStateException - if the configuration has already been registered.
    • register

      public String register(jakarta.security.auth.message.config.AuthConfigFactory authConfigFactory)
      Register the assembled configuration against the supplied AuthConfigFactory.
      Parameters:
      authConfigFactory - the AuthConfigFactory to register the configuration against.
      Returns:
      The registration ID returned by the factory on registration.
      Throws:
      IllegalStateException - if the configuration has already been registered.
    • builder

      public static JaspiConfigurationBuilder builder(String messageLayer, String applicationContext)