PreAuthenticatedAuthenticationToken
时间: 2023-08-27 12:10:21 浏览: 48
回答: PreAuthenticatedAuthenticationToken是Spring Security中的一个身份验证令牌,用于表示已经进行了身份验证的用户。它通常与PreAuthenticatedAuthenticationProvider一起使用,该提供程序可以将预先进行身份验证的信息与用户信息进行匹配。要使用PreAuthenticatedAuthenticationToken,只需将PreAuthenticatedAuthenticationProvider添加到authenticationManager中即可。可以通过AuthenticationManagerBuilder的configure方法将其添加到authenticationManager中。在Spring Security中,AuthenticationManager是根据最后一次调用authenticationManager()方法的WebSecurityConfigurerAdapter类来确定的。每次调用authenticationManager()方法,都会按照@Order配置的顺序调用WebSecurityConfigurerAdapter类或其子类的configure(AuthenticationManagerBuilder auth)方法。如果disableLocalConfigureAuthenticationBldr属性设置为true,则会调用GlobalAuthenticationConfigurerAdapter的init(AuthenticationManagerBuilder auth)方法来创建和设置AuthenticationManager。如果disableLocalConfigureAuthenticationBldr属性设置为false,则使用子类的configure(AuthenticationManagerBuilder auth)方法创建和设置的AuthenticationManager。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)