spring security的form-login是如何关联dao的
来源:互联网 发布:apache 二级域名配置 编辑:程序博客网 时间:2024/06/14 17:14
http://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#appendix-faq-what-is-userdetailservice
手册中说:
UserDetailsService is a DAO interface for loading data that is specific to a user account.
<http auto-config="true" authentication-manager-ref="authenticationManager" access-denied-page="/login.hb?error=2"> <form-login authentication-failure-url="/login.hb?error=1" username-parameter="username" password-parameter="password" login-processing-url="/login" login-page="/login.hb"/> </http> <authentication-manager id="authenticationManager"> <authentication-provider user-service-ref="userService"> <password-encoder hash="md5"/> </authentication-provider> </authentication-manager>
UserService 继承了UserDetailsService
public interface UserService extends UserDetailsService {}
public interface UserDetailsService { //~ Methods ======================================================================================================== /** * Locates the user based on the username. In the actual implementation, the search may possibly be case * insensitive, or case insensitive depending on how the implementation instance is configured. In this case, the * <code>UserDetails</code> object that comes back may have a username that is of a different case than what was * actually requested.. * * @param username the username identifying the user whose data is required. * * @return a fully populated user record (never <code>null</code>) * * @throws UsernameNotFoundException if the user could not be found or the user has no GrantedAuthority */ UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;}
@Service("userService")public class UserServiceImpl implements UserService { @Autowired private UserRepository userRepository; @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return }}
所以登录认证靠的是loadUserByUsername方法
没有action
0 0
- spring security的form-login是如何关联dao的
- Spring Security Form Login
- spring security中如何弹出登录模态框(form login与ajax login并存)
- Spring Security form login using database
- Spring Security Custom Login Form Example
- Spring Security Custom Login Form Annotation Example
- Spring Security form login using database
- spring security 实现form-login功能
- Spring boot 使用restful风格的spring security login
- Spring Security 的login(登录页)重构
- Spring Security 4 Custom Login Form Example(2)
- Spring Security自定义Login
- Spring Security中代理过滤器是通过FilterChain如何工作的
- Spring Security笔记:使用数据库进行用户认证(form login using database)
- spring security起步三:自定义登录配置与form-login属性详解
- spring security起步三:自定义登录配置与form-login属性详解
- spring security起步三:自定义登录配置与form-login属性详解
- ofbiz的form是如何生成的
- eclipse 关闭updating indexes
- Fasterrcnn mATLAB 版本调试CAFFE C++
- git 积累
- Android运行时权限简介及判断
- Rxjava学习心得!
- spring security的form-login是如何关联dao的
- 第一
- gnuplot安装
- webstorm 2017 激活破解
- java.lang.ClassNotFoundException(MyEclipse引入jar包找不到类的解决)
- mac配置tomcate时出现Permission denied
- SpringMVC 整合Jackson报错
- IP、子网掩码、网络号之间的关系、区分和运算
- Spring IOC 之Bean的作用域