# SpringSecurityDemo **Repository Path**: iquiet/spring-security-demo ## Basic Information - **Project Name**: SpringSecurityDemo - **Description**: 这是一个基于SpringSecurity+JWT实现权限认证的Demo,是根据B站三更草堂的视频一步一步配置的,文档和sql都有,希望可以帮助到大家 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2023-03-16 - **Last Updated**: 2024-03-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SpringSecurity+JWT实现权限认证 ### 写在前面 这是一个基于SpringSecurity+JWT实现权限认证的Demo,是根据B站三更草堂的视频一步一步配置的,文档和sql都有,希望可以帮助到大家 ### 运行本项目 1. git clone https://gitee.com/iquiet/spring-security-demo.git 2. 执行sql文件夹下的sql语句 3. 再application.yml里修改数据库信息 4. 运行主程序 5. 参考文档在doc文件夹下 ### 个人心得 #### 自定义认证成功(失败处理器) 当需要使用自定义认证逻辑时,我们可以对Security定义好的对应的接口进行重新实现,然后配置让SpringSecurity使用我们自定义的实现类 ```java @Component //自定义认证成功处理器 public class StarSuccessHandler implements AuthenticationSuccessHandler { @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { System.out.println("认证成功了"); } } ```