SimpleAuthConfigProvider (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.catalina.authenticator.jaspic, class: SimpleAuthConfigProvider

# Class SimpleAuthConfigProvider

java.lang.Object
org.apache.catalina.authenticator.jaspic.SimpleAuthConfigProvider

All Implemented Interfaces:
  `AuthConfigProvider`

public class SimpleAuthConfigProvider extends Object implements AuthConfigProvider
Basic implementation primarily intended for use when using third-party `ServerAuthModule` implementations that only provide the module.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleAuthConfigProvider(Map<String,String> properties, AuthConfigFactory factory)`
  Creates a new SimpleAuthConfigProvider.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected ServerAuthConfig`
  `createServerAuthConfig(String layer, String appContext, CallbackHandler handler, Map<String,String> properties)`
  Creates the ServerAuthConfig.
  `ClientAuthConfig`
  `getClientAuthConfig(String layer, String appContext, CallbackHandler handler)`
  `ServerAuthConfig`
  `getServerAuthConfig(String layer, String appContext, CallbackHandler handler)`
  `void`
  `refresh()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SimpleAuthConfigProvider

    public SimpleAuthConfigProvider(Map<String,String> properties, AuthConfigFactory factory)
    Creates a new SimpleAuthConfigProvider.
    Parameters:
      `properties` - Properties to pass to the ServerAuthConfig
      `factory` - AuthConfigFactory to register this provider with, or `null`

- ## Method Details

  - ### getClientAuthConfig

    public ClientAuthConfig getClientAuthConfig(String layer, String appContext, CallbackHandler handler) throws AuthException

    This implementation does not support client-side authentication and therefore always returns `null`.

    Specified by:
      `getClientAuthConfig` in interface `AuthConfigProvider`
    Throws:
      `AuthException`

  - ### getServerAuthConfig

    public ServerAuthConfig getServerAuthConfig(String layer, String appContext, CallbackHandler handler) throws AuthException

    The returned ServerAuthConfig is created lazily and cached.

    Specified by:
      `getServerAuthConfig` in interface `AuthConfigProvider`
    Throws:
      `AuthException`

  - ### createServerAuthConfig

    protected ServerAuthConfig createServerAuthConfig(String layer, String appContext, CallbackHandler handler, Map<String,String> properties)
    Creates the ServerAuthConfig. Can be overridden by subclasses to provide a custom implementation.
    Parameters:
      `layer` - Message layer
      `appContext` - Application context
      `handler` - Callback handler
      `properties` - Configuration properties
    Returns:
      The ServerAuthConfig instance

  - ### refresh

    public void refresh()

    Delegates refresh to the cached ServerAuthConfig if one has been created.

    Specified by:
      `refresh` in interface `AuthConfigProvider`