Interface PostAuthenticationFilter
For example, such a custom filter can be used to make sure that clients only can login from authorized computers by checking the client computers' IP numbers.
It can also be used to perform some kind of identity transformation, for example when the login identifier differs from the application identity.
May be combined with username/password authentication and a custom login page if some additional information (besides the username and the password) needs to be collected from the user and validated or logged.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionfilter
(SecurityContext securityContext, AuthenticationContext authContext) Applies a post authentication filter on the providedSecurityContext
argument.default void
init
(PostAuthenticationFilterInitContext initContext) Initializes thisPostAuthenticationFilter
.default void
setConfiguration
(String configuration) Deprecated.This method is deprecated and will be removed in a future release.
-
Method Details
-
init
default void init(PostAuthenticationFilterInitContext initContext) throws PostAuthenticationFilterException Initializes thisPostAuthenticationFilter
.The default implementation calls the deprecated
setConfiguration(String)
method.- Parameters:
initContext
- an initialization context containing parameters and other information that may be used by the implementing class- Throws:
PostAuthenticationFilterException
- if the initialization failed- Since:
- 10.1
-
setConfiguration
@Deprecated default void setConfiguration(String configuration) throws PostAuthenticationFilterException Deprecated.This method is deprecated and will be removed in a future release. Please implement theinit(PostAuthenticationFilterInitContext)
method instead.Set the configuration to be used when performing post authentication filtering. The semantics of the configuration argument is specific to the actualPostAuthenticationFilter
implementation. For example, it could be a configuration name, a filename or a key/value pair.The default implementation does nothing. Called by the default implementation of
init(PostAuthenticationFilterInitContext)
.- Parameters:
configuration
- the configuration- Throws:
PostAuthenticationFilterException
- if an error occurs setting the configuration- Since:
- 3.0
-
filter
Applies a post authentication filter on the providedSecurityContext
argument. If an authenticated user should be blocked by the filter, the filter should returnnull
.- Parameters:
securityContext
- theSecurityContext
object to be filteredauthContext
- the context in which the authentication takes place- Returns:
- a transformed
SecurityContext
value, ornull
when the authentication attempt is blocked - Since:
- 3.0
-