daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <authentication-manager alias="authenticationManager"/>
  2.  
  3. <beans:bean id="myFilter" class="test.MyAuthenticationProcessingFilter">
  4.     <custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
  5.     <beans:property name="defaultTargetUrl" value="/initialize.action"/>
  6.     <beans:property name="authenticationFailureUrl" value="/login_failed.action"/>
  7.     <beans:property name="authenticationManager" ref="authenticationManager"/>
  8.     <beans:property name="alwaysUseDefaultTargetUrl" value="true"/>
  9.     <beans:property name="filterProcessesUrl" value="/perform_login"/>
  10. </beans:bean>
  11.  
  12. <beans:bean id="entryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
  13.     <beans:property name="loginFormUrl" value="/login.action"/>
  14. </beans:bean>
  15.    
  16. @Override
  17. public Authentication attemptAuthentication(HttpServletRequest request)
  18.         throws AuthenticationException {
  19.     String param = request.getParameter("_spring_security_remember_me");
  20.  
  21.     HttpSession session = request.getSession();
  22.     if (session != null || getAllowSessionCreation()) {
  23.         session.setAttribute("_spring_security_remember_me", param);
  24.     }
  25.  
  26.     return super.attemptAuthentication(request);
  27. }
  28.  
  29. }
  30.    
  31. <beans:bean id="myFilter" class="test.MyAuthenticationProcessingFilter">
  32.     <custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
  33.     ...
  34. </beans:bean>
  35.    
  36. <http entry-point-ref="entryPoint">
  37.     ...
  38.     <!-- no form-login here -->
  39. </http>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top