上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 52 下一页
摘要: FilterSecurityInterceptor最后一个过滤器,主要做认证和授权拦截,比如我们未登录访问需要登录的页面或者我们配置了授权的页面 http.authorizeRequests() .antMatchers("/hello").hasRole("admin").antMatchers( 阅读全文
posted @ 2021-11-13 09:53 意犹未尽 阅读(1037) 评论(0) 推荐(1)
摘要: 统一的异常处理过滤器,我们可以处理统一的身份认证或者授权的异常 比如未登录访问登录页面 需要认证权限的地方 通过HttpSecurity 可以指定 通过org.springframework.security.config.annotation.web.configurers.ExceptionHa 阅读全文
posted @ 2021-11-12 19:16 意犹未尽 阅读(518) 评论(0) 推荐(0)
摘要: 实现记住密码的自动登录,比如session过期 初始化处 org.springframework.security.config.annotation.web.configurers.RememberMeConfigurer RememberMeAuthenticationProvider的作用可以 阅读全文
posted @ 2021-11-11 13:41 意犹未尽 阅读(182) 评论(0) 推荐(0)
摘要: 对Session控制和管理 配置 @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .anyRequest() .authenticated() .and 阅读全文
posted @ 2021-11-11 10:54 意犹未尽 阅读(833) 评论(0) 推荐(0)
摘要: 用于校验session是否过期 过期移除 初始化处:org.springframework.security.config.annotation.web.configurers.SessionManagementConfigurer#configure public void configure(H 阅读全文
posted @ 2021-11-10 20:00 意犹未尽 阅读(462) 评论(0) 推荐(0)
摘要: 最常用的一中过滤器,用于登录认证 http.formLogin() 初始化 类图 AbstractAuthenticationProcessingFilter负责 认证成功和认证失败的调度 提供抽象方法attemptAuthentication 具体的认证逻辑由子类实现 <1> org.sprin 阅读全文
posted @ 2021-11-10 19:05 意犹未尽 阅读(333) 评论(0) 推荐(0)
摘要: 负责处理登出相关逻辑,默认url映射是/logout org.springframework.security.config.annotation.web.configurers.LogoutConfigurer 初始化 默认初始化处https://www.cnblogs.com/LQBlog/p/ 阅读全文
posted @ 2021-11-10 15:22 意犹未尽 阅读(483) 评论(0) 推荐(0)
摘要: 提供我们在Filter链 执行之前或者之后往Header写入内容 通过HttpSecurity 可以指定 默认是在之后调用 http.headers().addHeaderWriter() 通过org.springframework.security.config.annotation.web.co 阅读全文
posted @ 2021-11-10 10:39 意犹未尽 阅读(493) 评论(0) 推荐(0)
摘要: 主要是在认证 Filter链执行之前 维护SecurityContextHolder 方便我们后续通过SecurityContextHolder.getContext()获取当前会话用户信息 通过SecurityContextConfigurer初始化 默认设置源码处:https://www.cnb 阅读全文
posted @ 2021-11-09 16:49 意犹未尽 阅读(1067) 评论(0) 推荐(0)
摘要: 作用 我们获取当前登录用户信息是根据SecurityContextHolder.getContext()获取的,SecurityContextHolder.getContext()本质是ThreadLocal实现 Spring MVC WebAsyncTask是异步另外一个线程 所以用于保证我们在T 阅读全文
posted @ 2021-11-09 14:15 意犹未尽 阅读(400) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 52 下一页