如何在WebSecurityConfigureAdapter和resourceserverconfigureradapter之间设置httpsecurity

dgjrabp2  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(299)

两者 WebSecurityConfigurerAdapter 以及 ResourceServerConfigurerAdapter 定义 configure(HttpSecurity http) 方法。然而,它们的运作方式似乎并不相同。例如,当我使用 WebSecurityConfigurerAdapter ,我不必定义 AuthenticationProvider 为了 UsernamePasswordAuthenticationToken ,不像我在 ResourceConfigurerAdapter . 因此,我更喜欢使用 configure 中的方法 WebSecurityConfigurerAdapter 但是,在我的设置中同时使用这两个配置程序会导致一个异常,即某些bean已经生成(我认为它是 springSecurityFilter ). 如何解决此冲突?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题