web/src/main/java/org/springframework/security/web/csrf/CsrfAuthenticationStrategy.java
@Override
	public void onAuthentication(Authentication authentication,
			HttpServletRequest request, HttpServletResponse response)
					throws SessionAuthenticationException {
		boolean containsToken = this.csrfTokenRepository.loadToken(request) != null;
		if (containsToken) {
			this.csrfTokenRepository.saveToken(null, request, response);

			CsrfToken newToken = this.csrfTokenRepository.generateToken(request);
			this.csrfTokenRepository.saveToken(newToken, request, response);

			request.setAttribute(CsrfToken.class.getName(), newToken);
			request.setAttribute(newToken.getParameterName(), newToken);
		}
	}
@Override
	public void onAuthentication(Authentication authentication,
			HttpServletRequest request, HttpServletResponse response)
					throws SessionAuthenticationException {
		boolean containsToken = this.csrfTokenRepository.loadToken(request) != null;
		if (containsToken) {
			this.csrfTokenRepository.saveToken(null, request, response);

			CsrfToken newToken = this.csrfTokenRepository.generateToken(request);
			this.csrfTokenRepository.saveToken(newToken, request, response);

			request.setAttribute(CsrfToken.class.getName(), newToken);
			request.setAttribute(newToken.getParameterName(), newToken);
		}
	}
@ Override public void onAuthentication ( Authentication authentication , HttpServletRequest request , HttpServletResponse response ) throws SessionAuthenticationException { boolean containsToken = this . csrfTokenRepository . loadToken ( request ) != null ; if ( containsToken ) { this . csrfTokenRepository . saveToken ( null , request , response ) ; CsrfToken newToken = this . csrfTokenRepository . generateToken ( request ) ; this . csrfTokenRepository . saveToken ( newToken , request , response ) ; request . setAttribute ( CsrfToken . class . getName ( ) , newToken ) ; request . setAttribute ( newToken . getParameterName ( ) , newToken ) ; } }
/*
(non-Javadoc)

@see org.springframework.security.web.authentication.session.
SessionAuthenticationStrategy
#onAuthentication(org.springframework.security.core.Authentication,
javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
/ * ( non - Javadoc )