mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-01 09:42:13 +00:00
Polish UsernamePasswordAuthenticationFilter method
Closes gh-10970
This commit is contained in:
parent
92a385ed05
commit
90fe1b3a69
@ -75,8 +75,7 @@ public class UsernamePasswordAuthenticationFilter extends AbstractAuthentication
|
|||||||
throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod());
|
throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod());
|
||||||
}
|
}
|
||||||
String username = obtainUsername(request);
|
String username = obtainUsername(request);
|
||||||
username = (username != null) ? username : "";
|
username = (username != null) ? username.trim() : "";
|
||||||
username = username.trim();
|
|
||||||
String password = obtainPassword(request);
|
String password = obtainPassword(request);
|
||||||
password = (password != null) ? password : "";
|
password = (password != null) ? password : "";
|
||||||
UsernamePasswordAuthenticationToken authRequest = UsernamePasswordAuthenticationToken.unauthenticated(username,
|
UsernamePasswordAuthenticationToken authRequest = UsernamePasswordAuthenticationToken.unauthenticated(username,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user