【问题标题】:Is there any Spring Social client module for ORCID?ORCID 是否有任何 Spring Social 客户端模块?
【发布时间】:2016-06-18 23:07:51
【问题描述】:

ORCID(开放研究人员和贡献者 ID)是否有任何 Spring Social 客户端模块?已经有Spring Social FacebookSpring Social TwitterSpring Social LinkedIn等服务提供者的客户端模块。

ORCID 提供了一个持久的数字标识符,可将一位研究人员与另一位研究人员区分开来。它已在全球范围内采用,在撰写本文时(2016 年 6 月),已注册近两百万个 ORCID iD。

ORCID 提供基于 OAuth 2.0 协议的 ORCID 的 SSO(Single Sign On)服务。越来越多的 Web 应用程序需要使用 ORCID 支持 SSO。可能还有更多的 Web 应用程序需要使用 ORCID 基于 OAuth 2.0 的 REST API,例如,将文章/数据提交到 ORCID Registry。

Spring Social 框架已被广泛用于将 Spring 应用程序连接到软件即服务 (SaaS) API 提供商,例如 Facebook、Twitter 和 LinkedIn。 ORCID 的 Spring Social 客户端模块,类似于 Spring Social Facebook 等,将极大地简化上述 Web 应用程序的开发,这将非常有利于出版商、研究所等在周围各学科的学术领域。世界。

【问题讨论】:

    标签: oauth-2.0 single-sign-on spring-social orcid


    【解决方案1】:

    我创建了the Spring Social ORCID project,作为 Spring Social 的扩展,可以与 ORCID 集成。 (注:这个项目我已经投给了欧洲PMC,新版本会发布到its GitHub repository

    我还编写了an example web application,它使用 Spring Social ORCID 模块(以及 Spring Social Facebook)来测试模块并演示如何使用它,其方式与使用 Spring Social 几乎相同脸书。

    不仅仅是 Web 应用程序,您还可以在 Web 服务中使用 Spring Social ORCID,如 the spring social orcid client example project on the rest_web_service branch 所示。该网络服务还支持“记住我”功能。

    任何 Web 应用程序都可以通过 JavaScript 使用基于 Spring Social ORCID 的 Web 服务连接到 ORCID。我创建了another example project 来演示这一点,它也利用了“记住我”功能。

    Spring Social ORCID 项目还远非完美,但我认为这不是一个糟糕的开始 :-) 欢迎您分叉并帮助改进它。

    【讨论】:

      【解决方案2】:

      为了跟进榆次,我创建了一个 Spring 和 Spring Boot 集成示例的存储库。有些只需要配置。 ORCID 最近发布了 OpenID Connect 和隐式 OAuth 功能,您现在还可以使用少量 javascript 进行客户端身份验证。

      ORCID端的变化意味着Spring boot只需要this

      @SpringBootApplication
      @EnableOAuth2Sso
      @Controller
      public class ReallySimpleOrcidOauthApplication {
      
          @RequestMapping("/")
          @ResponseBody
          public final String home() {
              return "Welcome, " + SecurityContextHolder.getContext().getAuthentication().getName();
          }
      
          public static void main(String[] args) {
              SpringApplication application = new SpringApplication(ReallySimpleOrcidOauthApplication.class);
              Properties properties = new Properties();
              properties.put("security.oauth2.client.clientId", "XXX");
              properties.put("security.oauth2.client.clientSecret", "XXX");
              properties.put("security.oauth2.client.accessTokenUri", "https://sandbox.orcid.org/oauth/token");
              properties.put("security.oauth2.client.userAuthorizationUri", "https://sandbox.orcid.org/oauth/authorize");
              properties.put("security.oauth2.client.tokenName", "access_token");
              properties.put("security.oauth2.client.scope", "openid");
              properties.put("security.oauth2.resource.userInfoUri", "https://sandbox.orcid.org/oauth/userinfo");
              application.setDefaultProperties(properties);
              application.run(args);
          }
      }
      

      还有一个使用 JWT 的仅客户端隐式流示例。这个以及更多 ORCID OAuth 和 OpenID 连接示例可以是 found on github

      【讨论】:

        猜你喜欢
        • 2020-05-26
        • 2011-10-04
        • 2011-10-09
        • 2021-12-23
        • 1970-01-01
        • 2017-11-28
        • 2017-09-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多