web/src/main/java/org/springframework/security/web/authentication/UsernamePasswordAuthenticationFilter.java
public Authentication attemptAuthentication(HttpServletRequest request,
			HttpServletResponse response) throws AuthenticationException {
		if (postOnly && !request.getMethod().equals("POST")) {
			throw new AuthenticationServiceException(
					"Authentication method not supported: " + request.getMethod());
		}

		String username = obtainUsername(request);
		String password = obtainPassword(request);

		if (username == null) {
			username = "";
		}

		if (password == null) {
			password = "";
		}

		username = username.trim();

		UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(
				username, password);

		// Allow subclasses to set the "details" property
		setDetails(request, authRequest);

		return this.getAuthenticationManager().authenticate(authRequest);
	}
public Authentication attemptAuthentication(HttpServletRequest request,
			HttpServletResponse response) throws AuthenticationException {
		if (postOnly && !request.getMethod().equals("POST")) {
			throw new AuthenticationServiceException(
					"Authentication method not supported: " + request.getMethod());
		}

		String username = obtainUsername(request);
		String password = obtainPassword(request);

		if (username == null) {
			username = "";
		}

		if (password == null) {
			password = "";
		}

		username = username.trim();

		UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(
				username, password);

		// Allow subclasses to set the "details" property
		setDetails(request, authRequest);

		return this.getAuthenticationManager().authenticate(authRequest);
	}
public Authentication attemptAuthentication ( HttpServletRequest request , HttpServletResponse response ) throws AuthenticationException { if ( postOnly && ! request . getMethod ( ) . equals ( "POST" ) ) { throw new AuthenticationServiceException ( "Authentication method not supported: " + request . getMethod ( ) ) ; } String username = obtainUsername ( request ) ; String password = obtainPassword ( request ) ; if ( username == null ) { username = "" ; } if ( password == null ) { password = "" ; } username = username . trim ( ) ; UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken ( username , password ) ; // Allow subclasses to set the "details" property setDetails ( request , authRequest ) ; return this . getAuthenticationManager ( ) . authenticate ( authRequest ) ; }
========================================================================================================
========================================================================================================