Interface PostAuthenticationFilter


public interface PostAuthenticationFilter
An interface defining the methods that must be implemented by a class to which post authentication filtering duties can be delegated.

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 Details

    • init

      Initializes this PostAuthenticationFilter.

      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 the init(PostAuthenticationFilterInitContext) method instead.
      Set the configuration to be used when performing post authentication filtering. The semantics of the configuration argument is specific to the actual PostAuthenticationFilter 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

      SecurityContext filter(SecurityContext securityContext, AuthenticationContext authContext)
      Applies a post authentication filter on the provided SecurityContext argument. If an authenticated user should be blocked by the filter, the filter should return null.
      Parameters:
      securityContext - the SecurityContext object to be filtered
      authContext - the context in which the authentication takes place
      Returns:
      a transformed SecurityContext value, or null when the authentication attempt is blocked
      Since:
      3.0