Class UsernameSubstringPreAuthenticatedProcessingFilter

  • All Implemented Interfaces:
    javax.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.ApplicationEventPublisherAware, org.springframework.context.EnvironmentAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware

    public class UsernameSubstringPreAuthenticatedProcessingFilter
    extends org.springframework.security.web.authentication.preauth.j2ee.J2eePreAuthenticatedProcessingFilter
    Specialization of J2eePreAuthenticatedProcessingFilter where getPreAuthenticatedPrincipal(HttpServletRequest) optionally extracts a substring of the user principal to use as the return value.

    The original user principal is stored in a request attribute named PENTAHO_ORIG_USER_PRINCIPAL.

    Author:
    mlowery
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String PENTAHO_ORIG_USER_PRINCIPAL
      Key under which original HttpServletRequest.getUserPrincipal() name is stored.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Object getPreAuthenticatedPrincipal​(javax.servlet.http.HttpServletRequest httpRequest)  
      void setRegex​(String regex)
      Regular expression where the first capture group will be extracted and used as the username.
      • Methods inherited from class org.springframework.security.web.authentication.preauth.j2ee.J2eePreAuthenticatedProcessingFilter

        getPreAuthenticatedCredentials
      • Methods inherited from class org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter

        afterPropertiesSet, doFilter, getAuthenticationDetailsSource, principalChanged, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setCheckForPrincipalChanges, setContinueFilterChainOnUnsuccessfulAuthentication, setInvalidateSessionOnPrincipalChange, setRequiresAuthenticationRequestMatcher, successfulAuthentication, unsuccessfulAuthentication
      • Methods inherited from class org.springframework.web.filter.GenericFilterBean

        addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
    • Field Detail

      • PENTAHO_ORIG_USER_PRINCIPAL

        public static final String PENTAHO_ORIG_USER_PRINCIPAL
        Key under which original HttpServletRequest.getUserPrincipal() name is stored.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UsernameSubstringPreAuthenticatedProcessingFilter

        public UsernameSubstringPreAuthenticatedProcessingFilter()
    • Method Detail

      • getPreAuthenticatedPrincipal

        protected Object getPreAuthenticatedPrincipal​(javax.servlet.http.HttpServletRequest httpRequest)
        Overrides:
        getPreAuthenticatedPrincipal in class org.springframework.security.web.authentication.preauth.j2ee.J2eePreAuthenticatedProcessingFilter
      • setRegex

        public void setRegex​(String regex)
        Regular expression where the first capture group will be extracted and used as the username. Set to null or empty string to disable matching and extraction.

        Example:

         .+\\(.+)
         
        The above example regular expression would extract USER from DOMAIN\USER.