Package com.emc.documentum.rest.security.filter

# Class ClientTokenPreAuthFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
com.emc.documentum.rest.security.filter.ClientTokenPreAuthFilter

All Implemented Interfaces:
  `jakarta.servlet.Filter`, `org.springframework.beans.factory.Aware`, `org.springframework.beans.factory.BeanNameAware`, `org.springframework.beans.factory.DisposableBean`, `org.springframework.beans.factory.InitializingBean`, `org.springframework.context.EnvironmentAware`, `org.springframework.core.env.EnvironmentCapable`, `org.springframework.web.context.ServletContextAware`

public class ClientTokenPreAuthFilter extends org.springframework.web.filter.GenericFilterBean
Filter to logout for client token cookie/header

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CLIENT_TOKEN_ERROR`

  ### Fields inherited from class org.springframework.web.filter.GenericFilterBean

  `logger`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClientTokenPreAuthFilter()`
  Default constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain)`
  Filter the request and the response.
  `protected void`
  `onSuccessfulAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, ClientTokenAuthToken authResult)`
  `protected void`
  `onUnsuccessfulAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException failed)`
  `void`
  `setAuthenticationManager(org.springframework.security.authentication.AuthenticationManager authenticationManager)`
  Set the authentication manager

  ### Methods inherited from class org.springframework.web.filter.GenericFilterBean

  `addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### CLIENT_TOKEN_ERROR

    public static final String CLIENT_TOKEN_ERROR
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ClientTokenPreAuthFilter

    public ClientTokenPreAuthFilter()
    Default constructor

- ## Method Details

  - ### doFilter

    public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
    Filter the request and the response. The filter validates the client token cookie/header and sets the `ClientTokenAuthToken` to the security context once the client token is validated. Optionally, it can validate the CSRF token associated with the client token cookie/header.
    Parameters:
      `req` - servlet request
      `res` - servlet request
      `chain` - servlet chain
    Throws:
      `IOException` - when there are errors in the authentication
      `jakarta.servlet.ServletException` - when there are errors in the authentication

  - ### setAuthenticationManager

    public void setAuthenticationManager(org.springframework.security.authentication.AuthenticationManager authenticationManager)
    Set the authentication manager
    Parameters:
      `authenticationManager` - the authentication manager

  - ### onSuccessfulAuthentication

    protected void onSuccessfulAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, ClientTokenAuthToken authResult)

  - ### onUnsuccessfulAuthentication

    protected void onUnsuccessfulAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException failed)