Class SimpleServerAuthConfig
java.lang.Object
org.apache.catalina.authenticator.jaspic.SimpleServerAuthConfig
- All Implemented Interfaces:
AuthConfig, ServerAuthConfig
Basic implementation primarily intended for use when using third-party
ServerAuthModule implementations that
only provide the module. This implementation supports configuring the ServerAuthContext with multiple
modules.-
Constructor Summary
ConstructorsConstructorDescriptionSimpleServerAuthConfig(String layer, String appContext, CallbackHandler handler, Map<String, Object> properties) Creates a new SimpleServerAuthConfig. -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerAuthContextcreateServerAuthContext(List<ServerAuthModule> modules) Creates the ServerAuthContext.Returns the application context for which this configuration applies.Returns theServerAuthContextfor the given authentication context ID.getAuthContextID(MessageInfo messageInfo) Determines the authentication context ID for the given message.Returns the message layer for which this configuration applies.booleanIndicates whether the authentication mechanism is protected, meaning that the configuration data is stored securely.voidrefresh()Refreshes the configuration, reloading any changed settings.
-
Constructor Details
-
SimpleServerAuthConfig
-
-
Method Details
-
getMessageLayer
Description copied from interface:jakarta.security.auth.message.config.AuthConfigReturns the message layer for which this configuration applies.- Specified by:
getMessageLayerin interfaceAuthConfig- Returns:
- the message layer
-
getAppContext
Description copied from interface:jakarta.security.auth.message.config.AuthConfigReturns the application context for which this configuration applies.- Specified by:
getAppContextin interfaceAuthConfig- Returns:
- the application context
-
getAuthContextID
Determines the authentication context ID for the given message.Returns the MessageInfo's string representation as the auth context ID.
- Specified by:
getAuthContextIDin interfaceAuthConfig- Parameters:
messageInfo- the message information used to determine the context ID- Returns:
- the authentication context ID, or
nullif no context applies
-
refresh
public void refresh()Refreshes the configuration, reloading any changed settings.Clears the cached ServerAuthConfig so it will be recreated on next use.
- Specified by:
refreshin interfaceAuthConfig
-
isProtected
public boolean isProtected()Indicates whether the authentication mechanism is protected, meaning that the configuration data is stored securely.This implementation always returns
false.- Specified by:
isProtectedin interfaceAuthConfig- Returns:
trueif the mechanism is protected,falseotherwise
-
getAuthContext
public ServerAuthContext getAuthContext(String authContextID, Subject serviceSubject, Map<String, Object> properties) throws AuthExceptionReturns theServerAuthContextfor the given authentication context ID.Loads ServerAuthModule instances from properties keyed with
org.apache.catalina.authenticator.jaspic.ServerAuthModule.Nwhere N is 1-based index. The returned context is cached and reused for subsequent calls.- Specified by:
getAuthContextin interfaceServerAuthConfig- Parameters:
authContextID- the authentication context identifierserviceSubject- the service subjectproperties- the configuration properties- Returns:
- the server authentication context
- Throws:
AuthException- if an error occurs during authentication context creation
-
createServerAuthContext
Creates the ServerAuthContext. Can be overridden by subclasses to provide a custom implementation.- Parameters:
modules- List of ServerAuthModule instances- Returns:
- The ServerAuthContext instance
-