【问题标题】:spring-security-oauth2 vs spring-security-oauth2-core in SpringSpring 中的 spring-security-oauth2 与 spring-security-oauth2-core
【发布时间】:2019-09-25 05:04:18
【问题描述】:

spring-security-oauth2和spring-security-oauth2-core有什么区别? spring-security-oauth2 被 spring-security-oauth2-core 替代了吗?

spring-security-oauth2 发布链接: http://repo.spring.io/release/org/springframework/security/oauth/spring-security-oauth2/

spring-security-oauth2-core 发布链接 http://repo.spring.io/release/org/springframework/security/spring-security-oauth2-core/

【问题讨论】:

    标签: spring spring-security spring-security-oauth2


    【解决方案1】:

    是的,有很大的不同。 spring-security-oauth2(Spring Security OAuth 项目)是no longer being actively developed

    展望未来,它将在 Spring Security 5 中实现(在 spring-security-oauth2-core 中)。这很令人困惑,因为许多教程使用以前的 Spring Security OAuth(@EnableResourceServer@EnableAuthorizationServer@EnableOAuth2Sso 注释通常会放弃它)。

    【讨论】:

      【解决方案2】:

      第一个链接与 Spring 4 相关,它与 Spring Security 版本相匹配。您可以在 pom.xml 文件中验证这一点。

      第二个链接与 Spring 5 和 Spring Security 5 相关。这不仅可以从您在该链接中看到的版本中直接看出,而且您可以在 Spring Security 5 documentation 中找到直接命名的依赖项。

      【讨论】:

        【解决方案3】:

        区别在spring git仓库中有描述

        https://github.com/spring-projects/spring-security/wiki/OAuth-2.0-Migration-Guide

        它是旧库:security/oauth/spring-security-oauth2/ 如您所见,该库位于 spring-security 的“oauth”组中。

        我不建议将旧库用作客户端,因为存在许多未解决的问题,包括有关存储 clientContext 的问题(库使用代理而不是普通实体,因此您在使用 MA 时会遇到问题带分布式缓存)。此外,它不允许同时使用多个 OAuth2.0 提供程序(只有一个)。

        同时,该库提供了一个显着优势,即使用未在新库中实现的授权服务器。

        【讨论】:

          猜你喜欢
          • 2017-09-11
          • 2019-04-29
          • 2016-03-05
          • 2019-04-28
          • 2015-11-14
          • 2016-07-12
          • 2017-01-18
          • 2012-12-19
          • 1970-01-01
          相关资源
          最近更新 更多