Class SimpleAuthConfigProvider
java.lang.Object
org.apache.catalina.authenticator.jaspic.SimpleAuthConfigProvider
- All Implemented Interfaces:
AuthConfigProvider
Basic implementation primarily intended for use when using third-party
ServerAuthModule implementations that only provide the module.-
Constructor Summary
ConstructorsConstructorDescriptionSimpleAuthConfigProvider(Map<String, Object> properties, AuthConfigFactory factory) Creates a new SimpleAuthConfigProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerAuthConfigcreateServerAuthConfig(String layer, String appContext, CallbackHandler handler, Map<String, Object> properties) Creates the ServerAuthConfig.getClientAuthConfig(String layer, String appContext, CallbackHandler handler) Returns the client-side authentication configuration for the specified layer and application context.getServerAuthConfig(String layer, String appContext, CallbackHandler handler) Returns the server-side authentication configuration for the specified layer and application context.voidrefresh()Refreshes the configuration, reloading any changed settings from the underlying source.
-
Constructor Details
-
SimpleAuthConfigProvider
Creates a new SimpleAuthConfigProvider.- Parameters:
properties- Properties to pass to the ServerAuthConfigfactory- AuthConfigFactory to register this provider with, ornull
-
-
Method Details
-
getClientAuthConfig
public ClientAuthConfig getClientAuthConfig(String layer, String appContext, CallbackHandler handler) throws AuthException Returns the client-side authentication configuration for the specified layer and application context.This implementation does not support client-side authentication and therefore always returns
null.- Specified by:
getClientAuthConfigin interfaceAuthConfigProvider- Parameters:
layer- the message layerappContext- the application contexthandler- the callback handler for obtaining sensitive configuration data- Returns:
- the ClientAuthConfig, or
nullif no configuration is available - Throws:
AuthException- if an error occurs while retrieving the configuration
-
getServerAuthConfig
public ServerAuthConfig getServerAuthConfig(String layer, String appContext, CallbackHandler handler) throws AuthException Returns the server-side authentication configuration for the specified layer and application context.The returned ServerAuthConfig is created lazily and cached.
- Specified by:
getServerAuthConfigin interfaceAuthConfigProvider- Parameters:
layer- the message layerappContext- the application contexthandler- the callback handler for obtaining sensitive configuration data- Returns:
- the ServerAuthConfig, or
nullif no configuration is available - Throws:
AuthException- if an error occurs while retrieving the configuration
-
createServerAuthConfig
protected ServerAuthConfig createServerAuthConfig(String layer, String appContext, CallbackHandler handler, Map<String, Object> properties) Creates the ServerAuthConfig. Can be overridden by subclasses to provide a custom implementation.- Parameters:
layer- Message layerappContext- Application contexthandler- Callback handlerproperties- Configuration properties- Returns:
- The ServerAuthConfig instance
-
refresh
public void refresh()Refreshes the configuration, reloading any changed settings from the underlying source.Delegates refresh to the cached ServerAuthConfig if one has been created.
- Specified by:
refreshin interfaceAuthConfigProvider
-