<security-constraint>
elements in the web application deployment descriptor. This functionality is implemented as a Valve so that it can be
omitted in environments that do not require these features. Individual implementations of each supported
authentication method can subclass this base class as required.
USAGE CONSTRAINT: When this class is utilized, the Context to which it is attached (or a parent Container in a hierarchy) must have an associated Realm that can be used for authenticating users and enumerating the roles to which they have been assigned.
USAGE CONSTRAINT: This Valve is only useful when processing HTTP requests. Requests of any other type will simply be passed through.
| Modifier and Type | Class and Description |
|---|---|
| protected static enum | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private AuthenticatorBase. | |
| protected boolean | alwaysUseSession
Should a session always be used once a user is authenticated? |
| protected static final String | AUTH_HEADER_NAME
Authentication header |
| protected boolean | cache
Should we cache authenticated Principals if the request is part of an HTTP session? |
| protected boolean | changeSessionIdOnAuthentication
Should the session ID, if any, be changed upon a successful authentication to prevent a session fixation attack? |
| protected Context | context
The Context to which this Valve is attached. |
| private static final String | DATE_ONE
"Expires" header always set to Date(1), so generate once only |
| protected boolean | disableProxyCaching
Flag to determine if we disable proxy caching, or leave the issue up to the webapp developer. |
| private volatile String | |
| private volatile CallbackHandler | |
| protected String | jaspicCallbackHandlerClass
The name of the JASPIC callback handler class. |
| private volatile Optional | |
| private final Log | |
| protected static final String | REALM_NAME
Default authentication realm name. |
| protected boolean | securePagesWithPragma
Flag to determine if we disable proxy caching with headers incompatible with IE. |
| protected String | secureRandomAlgorithm
The name of the algorithm to use to create instances of |
| protected String | secureRandomClass
The Java class name of the secure random number generator class to be used when generating SSO session identifiers. |
| protected String | secureRandomProvider
The name of the provider to use to create instances of |
| protected boolean | sendAuthInfoResponseHeaders
Should the auth information (remote user and auth type) be returned as response headers for a forwarded/proxied request? |
| protected SessionIdGeneratorBase | |
| protected static final StringManager | sm
The string manager for this package.
|
| protected SingleSignOn | sso
The SingleSignOn implementation in our request processing chain, if there is one. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| protected void | |
| public boolean | authenticate(Request
Request we are processing request, HttpServletResponse Response we are populating httpResponse)Implements org. Authenticate the user making this request, based on the login
configuration of the |
| private boolean | authenticateJaspic(Request request, Response response, AuthenticatorBase.
|
| protected String | |
| protected boolean | Returns: true if the user was authenticated via the cache, otherwise falseThe current request request, HttpServletResponse The current response response, boolean Should information available from SSO be used to attempt to authenticate the current user? useSSO)Check to see if the user has already been authenticated earlier in the processing chain or if there is enough information available to authenticate the user without requiring further user interaction. |
| private CallbackHandler | |
| protected abstract boolean | Returns: true if the the user was authenticated, otherwise false, in which case an authentication challenge will have been written to the responseThe request that triggered the authentication request, HttpServletResponse The response associated with the request response)Provided for sub-classes to implement their specific authentication mechanism. |
| protected Principal | |
| private Optional | |
| public String | |
| public boolean | |
| protected abstract String | Returns: the authentication method, which is vendor-specific and not defined by HttpServletRequest.Return the authentication method, which is vendor-specific and not defined by HttpServletRequest. |
| public boolean | Returns: true if authenticated Principals will be cached, otherwise falseReturn the cache authenticated Principals flag. |
| private CallbackHandler | |
| public boolean | Returns: true to change session ID upon successful authentication, false to do not
perform the change.Return the flag that states if we should change the session ID of an existing session upon successful authentication. |
| public Container | getContainer()
Overrides org. Implements org. Get the |
| public boolean | Returns: true if the headers will be added, otherwise falseReturn the flag that states if we add headers to disable caching by proxies. |
| public String | Returns: The name of the JASPIC callback handlerReturn the JASPIC callback handler class name |
| private AuthConfigProvider | |
| private AuthenticatorBase. | getJaspicState(AuthConfigProvider jaspicProvider, Request request, Response response, boolean authMandatory)
|
| private GenericPrincipal | |
| protected static String | |
| public boolean | Returns: true if a Pragma header should be used, otherwise falseReturn the flag that states, if proxy caching is disabled, what headers we add to disable the caching. |
| public String | Returns: The name of the SecureRandom algorithm usedReturn the secure random number generator algorithm name. |
| public String | Returns: The fully qualified name of the SecureRandom implementation to useReturn the secure random number generator class name. |
| public String | Returns: The name of the SecureRandom providerReturn the secure random number generator provider name. |
| public void | invoke(Request
Request to be processed request, Response Response to be processed response)Implements org. Enforce the security restrictions in the web application deployment descriptor of our associated Context. |
| protected boolean | Returns: true if authenticate() must be called, otherwise falseThe request currently being processed request)Does this authenticator require that |
| protected boolean | Returns: true if preemptive authentication is possible, otherwise falseThe request to check for credentials request)Can the authenticator perform preemptive authentication for the given request? |
| public boolean | Returns: true if response headers shall be sent, false otherwiseReturns the flag whether authentication information will be sent to a reverse proxy on a forwarded request. |
| public void | login(String username, String password, Request request)
Implements org.
|
| public void | |
| public void | notify(String layer, String appContext)
Implements jakarta.
|
| protected boolean | Returns: true if the reauthentication from SSL occurredidentifier of SingleSignOn session with which the caller is associated ssoId, Request the request that needs to be authenticated request)Attempts reauthentication to the |
| public void | register(Request
The servlet request we are processing request, HttpServletResponse The servlet response we are generating response, Principal The authenticated Principal to be registered principal, String The authentication type to be registered authType, String Username used to authenticate (if any) username, String Password used to authenticate (if any) password)Register an authenticated Principal and authentication type in our request, in the current session (if there is one), and with our SingleSignOn valve, if there is one. |
| protected void | register(Request
The servlet request we are processing request, HttpServletResponse The servlet response we are generating response, Principal The authenticated Principal to be registered principal, String The authentication type to be registered authType, String Username used to authenticate (if any) username, String Password used to authenticate (if any) password, boolean Should a session always be used once a user is authenticated? alwaysUseSession, boolean Should we cache authenticated Principals if the request is part of an HTTP session? cache)Register an authenticated Principal and authentication type in our request, in the current session (if there is one), and with our SingleSignOn valve, if there is one. |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | setChangeSessionIdOnAuthentication(boolean
true to change session ID upon successful authentication,
false to do not perform the change.Set the value of the flag that states if we should change the session ID of an existing session upon successful authentication. |
| public void | setContainer(Container
The Container instance with which this instance is to
be associated, or container)null to disassociate this instance
from any ContainerOverrides org. Implements org. Set the |
| public void | setDisableProxyCaching(boolean
true if we add headers to disable proxy caching, false if we leave the
headers alone.Set the value of the flag that states if we add headers to disable caching by proxies. |
| public void | setJaspicCallbackHandlerClass(String
The new JASPIC callback handler class name jaspicCallbackHandlerClass)Set the JASPIC callback handler class name |
| public void | setSecurePagesWithPragma(boolean
true if we add headers which are incompatible with downloading office
documents in IE under SSL but which fix a caching problem in Mozilla.Set the value of the flag that states what headers we add to disable proxy caching. |
| public void | setSecureRandomAlgorithm(String
The new secure random number generator algorithm name secureRandomAlgorithm)Set the secure random number generator algorithm name. |
| public void | setSecureRandomClass(String
The new secure random number generator class name secureRandomClass)Set the secure random number generator class name. |
| public void | setSecureRandomProvider(String
The new secure random number generator provider name secureRandomProvider)Set the secure random number generator provider name. |
| public void | setSendAuthInfoResponseHeaders(boolean
true if response headers shall be sent, false otherwiseSets the flag whether authentication information will be send to a reverse proxy on a forwarded request. |
| protected void | startInternal()
Overrides org. Start this component and implement the requirements of
|
| protected void | stopInternal()
Overrides org. Stop this component and implement the requirements of
|