1

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 注册表。

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

4

2 回答 2

2

我创建了 Spring Social ORCID 项目,作为 Spring Social 的扩展,可以与 ORCID 集成。(注:我已经把这个项目献给了欧洲 PMC,新版本将发布到它的 GitHub 存储库

我还编写了一个示例 Web 应用程序,它使用 Spring Social ORCID 模块(以及 Spring Social Facebook)来测试模块并演示如何使用它,其方式与使用 Spring Social Facebook 几乎相同。

不仅是 Web 应用程序,您还可以在 Web 服务中使用 Spring Social ORCID,如rest_web_service 分支上的 spring social orcid 客户端示例项目所示。Web 服务还支持“记住我”功能。

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

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

于 2016-06-18T23:07:51.490 回答
0

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

ORCID 端的更改意味着 Spring boot 只需要以下内容:

@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 连接示例可以在 github上找到

于 2017-11-09T12:32:25.103 回答