Spring-Security-Oauth2: Full authentication is required to access this resource

前端 未结 7 2003
面向向阳花
面向向阳花 2020-12-02 18:20

I am trying to use spring-security-oauth2.0 with Java based configuration. My configuration is done, but when i deploy application on tomcat and hit the

7条回答
  •  醉酒成梦
    2020-12-02 19:15

    You should pre authenticate the token apis "/oauth/token"

    extend ResourceServerConfigurerAdapter and override configure function to do this.

    eg:

    http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().authorizeRequests().antMatchers("/oauth/token").permitAll().
    anyRequest().authenticated();
    

提交回复
热议问题