Correctly configure spring security oauth2

前端 未结 1 553
时光取名叫无心
时光取名叫无心 2021-01-27 06:12

I\'m trying to configure an authorization server with spring-security-oauth2 and jwt.

My main :

@SpringBootApplication
@EnableResourceServer
public class         


        
1条回答
  •  清歌不尽
    2021-01-27 06:56

    Actually it's a problem with spring security. The solution is in this thread :

    https://github.com/spring-projects/spring-security-oauth/issues/980

    This annotation should be added for the Adapter to be correctly called :

    @Configuration 
    @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) 
    class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { 
        // ...
    }
    

    Another solution is to implement ResourceServerConfigurerAdapter instead of WebSecurityConfigurerAdapter.

    0 讨论(0)
提交回复
热议问题