Skip to content

echo467/SpringSecurity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

SpringSecurity

springsecurity登录(不含数据库)
详情见链接 https://juejin.im/post/5ccb0acb6fb9a032435db68f#heading-0

一般开发步骤


1.测试登录

导入依赖,springSecurity,web,mysql,thymeleaf  
编写测试方法,UserController  
测试,localhost:8080  

2.自定义登录接口

MyUserDetailsService,加载用户特定的数据  
MySecurityConfig,配置登录拦截  
myPasswordEncoder,加入密码编码器组件  

3.密码加密

MySecurityConfig,注入密码编码器对象,继承webSecurityConfigureAdapter  
MyUserDetailsService,完善服务层 

4.自定义登陆界面

 自定义前端页面,login.html,index,html  
 UserController添加转跳路径  
 MySecurityConfig,修改拦截配置  
 MyAuthenticationSuccessHandler,MyAuthenticationFailureHandler自定义登录请求状态 或者修改MySecurityConfig的配置方法  
 UserController获取当前用户信息   

About

springsecurity登录(不含数据库)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published