所以基本上我想用OAuth 2.0保护我的API并实现OAuth提供程序以启用accessTokens等的查询。
可以用JOAuth开箱即用吗?
有没有人用开源库(Java)实现了类似的东西?
Spring Security有一个OAuth子项目,支持OAuth 1.0a和OAuth2(客户端和服务器)。他们在GitHub仓库上有示例代码:
Apache Amber(http://oltu.apache.org/)是另一个项目(现已弃用),它使构建OAuth2提供程序变得非常简单。看到:
https://github.com/OpenConextApps/apis是OAuth2授权服务器的完整Java开源实现。
OAuth 2.0 Code and Services的实现部分以非常全面的方式列出了服务器端库和客户端库。
您可以下载提供商和客户端源代码。
https://github.com/stepanowon/OAuth_20
但是,评论是由韩国人写的。你必须阅读rfc文件。我没有使用spring-security。
你可以尝试https://github.com/apifest/apifest-oauth20。它是一个用纯Java编写的开源项目,实现了OAuth 2.0规范 - https://tools.ietf.org/html/rfc6749。
你也可以使用CloudFoundry User Account and Authentication (UAA) Server
它支持:OAuth2,OpenId Connect,SCIM,SSO
对于Play Framework(Scala),您可以使用https://github.com/nulab/scala-oauth2-provider
你可以叉scribe git repository on github。我使用了scribe,这非常简单,而Pablo(创作者)很适合。他会帮助你的。