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

前端 未结 7 1972
面向向阳花
面向向阳花 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();
    
    0 讨论(0)
提交回复
热议问题