spring-security-oauth2-client 和 spring-security-oauth 之间有什么关系?

What is the relation between spring-security-oauth2-client and spring-security-oauth?

有一个spring项目spring-security-oauth http://projects.spring.io/spring-security-oauth/docs/oauth2.html

dev guide

Source code

然后在spring-security下, 还有oauth

Source code

在springboot doc中,它使用spring-security-oauth2-client,来自spring-security

而在 springboot OAuth2 tutorial 中,它使用另一个 org.springframework.security.oauth.boot

有什么区别?什么时候使用哪个?

注意 spring 也可以处理旧协议 OAuth (V1)。所以你必须确定你使用的是哪个版本,两者互不兼容。

为了保护您的应用程序,请参阅本指南:https://ordina-jworks.github.io/microservices/2017/09/26/Secure-your-architecture-part1.html 它提供了许多 spring 组件及其交互的信息。这里当然用到了OAuth2。

目前有一个过渡期,其中 spring-security-oauth2 已进入维护模式,同时功能正在从那里和其他一些地方整合到 Spring Security 5 的新 OAuth2 部分.

详见this post from the Spring team