使用 spring security 实现了一个自定义的登陆过程实现 AuthenticationProvider
其中 获取用户名和密码的部分 在系统运行一段时间后总是得到空字符串
把服务器重启一下就又好了 再运行几天又得不到实际的用户名密码了
请问可能是什么问题?
可以确定客户端发送的 request 没有问题
public class LoginProvider implements AuthenticationProvider {
...
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
String userId = authentication.getName();
String password = authentication.getCredentials().toString();
// userId == "", password == ""
...
}
}