UsernamePasswordAuthenticationToken的用法
时间: 2023-11-08 19:55:30 浏览: 138
基于Token的身份验证的方法
UsernamePasswordAuthenticationToken是Spring Security中用于封装用户名密码认证信息的类。它实现了Authentication接口,用于表示一个认证请求。它的构造方法接受两个参数,分别是principal和credentials,用于传递用户名和密码信息。这个方法可以帮助我们处理用户登录认证的过程。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [UsernamePasswordAuthenticationToken使用](https://blog.csdn.net/qq_54693844/article/details/129293101)[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%"]
- *3* [Spring Boot 2 + Spring Security 5 + JWT 的单页应用 Restful 解决方案](https://download.csdn.net/download/qq_29235677/87881070)[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 ]
阅读全文