发现使用sercurity进行自定义身份证验证时,后台自定义方法实现
UserDetailsService无法接受到前台页面传递的参数。security只接受参数名是username的参数,
所以定时表单名字时候,一定要注意,大小写差一个都不行,程序员习惯将userName驼峰命名,吃大亏了。。。
输入错误,报错如下:
ERROR UsernamePasswordAuthenticationFilter:221 - An internal error occurred while trying to authenticate the user.
org.springframework.security.authentication.InternalAuthenticationServiceException
at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:123)