setAuthentication
时间: 2023-10-15 17:24:11 浏览: 87
setAuthentication方法是Spring Security中的一个方法,用于设置用户的身份认证信息。该方法通常在身份验证成功后被调用,用于将认证信息存储到SecurityContext中。在后续的请求中,可以通过SecurityContextHolder来访问和使用这些认证信息。这样可以确保在用户的每个请求中都可以获取到正确的身份认证信息,以便进行权限检查和访问控制。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Spring-Security学习笔记【二】Authentication认证](https://blog.csdn.net/Sky_QiaoBa_Sum/article/details/107487268)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [SpringSecurity 笔记](https://blog.csdn.net/cjj2006/article/details/127518786)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文