Class AuthenticationProcessingFilter2

  • 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.context.MessageSourceAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware

    @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
    public final class AuthenticationProcessingFilter2
    extends org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
    Login filter with a change for Jenkins so that we can pick up the hidden "from" form field defined in login.jelly to send the user back to where he came from, after a successful authentication.
    Author:
    Kohsuke Kawaguchi
    • Field Summary

      • Fields inherited from class org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter

        SPRING_SECURITY_FORM_PASSWORD_KEY, SPRING_SECURITY_FORM_USERNAME_KEY
      • Fields inherited from class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter

        authenticationDetailsSource, eventPublisher, messages
      • Fields inherited from class org.springframework.web.filter.GenericFilterBean

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void successfulAuthentication​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain, org.springframework.security.core.Authentication authResult)  
      protected void unsuccessfulAuthentication​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException failed)
      Leave the information about login failure.
      • Methods inherited from class org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter

        attemptAuthentication, getPasswordParameter, getUsernameParameter, obtainPassword, obtainUsername, setDetails, setPasswordParameter, setPostOnly, setUsernameParameter
      • Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter

        afterPropertiesSet, doFilter, getAllowSessionCreation, getAuthenticationManager, getFailureHandler, getRememberMeServices, getSuccessHandler, requiresAuthentication, setAllowSessionCreation, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setContinueChainBeforeSuccessfulAuthentication, setFilterProcessesUrl, setMessageSource, setRememberMeServices, setRequiresAuthenticationRequestMatcher, setSecurityContextHolderStrategy, setSecurityContextRepository, setSessionAuthenticationStrategy
      • Methods inherited from class org.springframework.web.filter.GenericFilterBean

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

      • AuthenticationProcessingFilter2

        public AuthenticationProcessingFilter2​(String authenticationGatewayUrl)
    • Method Detail

      • successfulAuthentication

        protected void successfulAuthentication​(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response,
                                                javax.servlet.FilterChain chain,
                                                org.springframework.security.core.Authentication authResult)
                                         throws IOException,
                                                javax.servlet.ServletException
        Overrides:
        successfulAuthentication in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
        Throws:
        IOException
        javax.servlet.ServletException
      • unsuccessfulAuthentication

        protected void unsuccessfulAuthentication​(javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  org.springframework.security.core.AuthenticationException failed)
                                           throws IOException,
                                                  javax.servlet.ServletException
        Leave the information about login failure.
        Overrides:
        unsuccessfulAuthentication in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
        Throws:
        IOException
        javax.servlet.ServletException