Moving to Spring Boot 1.5.1 and OAuth2 + JWT token - Error 401 Unauthorized

♀尐吖头ヾ 提交于 2019-12-04 12:36:42

I found the reason of this issue:

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.5-Release-Notes

OAuth 2 Resource Filter

The default order of the OAuth2 resource filter has changed from 3 to SecurityProperties.ACCESS_OVERRIDE_ORDER - 1. This places it after the actuator endpoints but before the basic authentication filter chain. The default can be restored by setting security.oauth2.resource.filter-order = 3

So, adding the security.oauth2.resource.filter-order = 3 to application.properties did the trick! Now everything works as expected.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!