Spring Security circular bean dependency

后端 未结 5 1331
梦毁少年i
梦毁少年i 2020-12-13 14:25

I\'m currently working on a Vaadin spring application. According to the app specifications, authentication/authorization of the users must be completed by querying database

5条回答
  •  有刺的猬
    2020-12-13 14:42

    Your PasswordEncoder bean definition is in WebSecurityConfig which needs JdbcUserDetailsServices. JdbcUserDetailsServices again is dependent on JdbcAccountRepository which needs PasswordEncoder. So the cycle forms. A simple solution is to take out the PasswordEncoder bean definition out of WebSecurityConfig. Even inside SecurityConfiguration class will solve the cyclic problem.

提交回复
热议问题