OAuth2 with Spring Boot REST application - cannot access resource with token

后端 未结 1 820
灰色年华
灰色年华 2020-12-15 13:09

I want to use OAuth2 for my REST spring boot project. Using some examples I have created configuration for OAuth2:

         


        
相关标签:
1条回答
  • 2020-12-15 13:23

    If you are using spring boot 1.5.1 or recently updated to it, note that they changed the filter order for spring security oauth2 (Spring Boot 1.5 Release Notes).

    According to the release notes, try to add the following property to application.properties/yml, after doing that the resource server filters will be used after your other filters as a fallback - this should cause the authorization to be accepted before falling to the resource server:

    security.oauth2.resource.filter-order = 3
    

    You can find a good answer for your other questions here: https://stackoverflow.com/questions/28537181

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