问题描述
所以基本上我想用OAuth 2.0保护我的API,并实现一个OAuth Provider来启用对accessTokens的获取.
So basically I want to protect my APIs with OAuth 2.0 and implement an OAuth Provider to enable acquiry of accessTokens etc.
可以立即使用JOAuth完成吗?
Can it be done with JOAuth out of the box?
有人用开放源代码库(Java)实现了类似的东西吗?
Has anybody already implemented something like this with an Open Source library (Java)?
推荐答案
Spring Security的OAuth子项目支持OAuth 1.0a和OAuth2(客户端和服务器).他们在GitHub存储库中有示例代码:
Spring Security has an OAuth sub-project with support for OAuth 1.0a and OAuth2 (both client and server). They have sample code on their GitHub repo:
- 主要回购协议: https://github.com/spring-projects/spring-security-oauth
- OAuth2提供程序示例(称为sparklr):https://github.com/spring-projects/spring-security-oauth/tree/master/samples/oauth2/sparklr
Apache Amber( http://oltu.apache.org/)是另一个项目(现在已弃用),这使得构建OAuth2提供程序非常简单.参见:
Apache Amber (http://oltu.apache.org/) is another project (now deprecated) that makes it fairly straightforward to build an OAuth2 provider. See:
- https://cwiki.apache.org/confluence/display/OLTU/OAuth + 2.0 + Authorization + Server 用于授权服务器
- https://cwiki.apache.org/confluence/用于资源服务器的display/OLTU/OAuth + 2.0 + Resource + Server
这篇关于Java中是否有OAuth 2.0提供程序实现?(不是oauth客户端)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!