So basically I want to protect my APIs with OAuth 2.0 and implement an OAuth Provider to enable acquiry of accessTokens etc.
Can it be done with JOAuth out of the box?
Has anybody already implemented something like this with an Open Source library (Java)?
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:
- Main repo: https://github.com/spring-projects/spring-security-oauth
- Sample OAuth2 provider (called sparklr): https://github.com/spring-projects/spring-security-oauth/tree/master/samples/oauth2/sparklr
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 for the Authorization server
- https://cwiki.apache.org/confluence/display/OLTU/OAuth+2.0+Resource+Server for the Resource server
Well so many implementations for OAuth2 in Java
https://github.com/OpenConextApps/apis is an full-fledged Java Open Source Implementation of an OAuth2 authorization server.
The implementations section of OAuth 2.0 Code and Services listed both server side libraries and client libraries in a quite comprehensive manner.
you can download provider & client source codes.
https://github.com/stepanowon/OAuth_20
but, the comment was written by korean. you must read rfc documents. i didn't use spring-security.
You can try https://github.com/apifest/apifest-oauth20. It's an open-source project written in pure Java and implements the OAuth 2.0 specification - https://tools.ietf.org/html/rfc6749.
You can also use CloudFoundry User Account and Authentication (UAA) Server
It Supports: OAuth2, OpenId Connect, SCIM, SSO
You can clone it from https://github.com/cloudfoundry/uaa.
For Play Framework (Scala) you can use https://github.com/nulab/scala-oauth2-provider
You could fork the scribe git repository on github. I've used scribe and it's super easy, and Pablo (the creator) is great to work with. He'll help you out.
来源:https://stackoverflow.com/questions/10296681/is-there-an-oauth-2-0-provider-implementation-in-java-not-oauth-client