views:

1582

answers:

2

What is the fastest/easiest way to get an OAuth provider running in Java? Specifically, I need to authorize third-party apps to access certain web services (I'm thinking token authentication using OAuth).

I've been looking at Jersey's OAuth extension, but as mentioned here, it doesn't provide a full-fledged Service Provider.

A: 

Take a look at some of the alternatives at http://wiki.openid.net/Run-your-own-identity-server

stimms
Thanks, I'll take a look.
jay_soo
That document describes running an OpenID provider, not an OAuth service provider.
Paul Osman
+4  A: 

There are a few Java libraries out there for OAuth. Specifically, I'd have a look at this one. I haven't used it myself, but there is an example for running an OAuth Service Provider.

There's a list of libraries available on the OAuth website: http://oauth.net/code

Paul Osman
I did eventually go for the net.oauth Java package. The net.oauth.example.provider was pretty useful.I also came across the Spring's OAuth tutorial: http://spring-security-oauth.codehaus.org/tutorial.html. But since I'm not running Spring, it wasn't very useful for me.
jay_soo
Since so many people have viewed this, I just want to add that I took the example servlets in org.biomart.oauth.provider.servlets to handle OAuth (barely modified). http://oauth.googlecode.com/svn/code/java/example/oauth-provider/The JavaScript client helped a lot to test my implementation. http://oauth.googlecode.com/svn/code/javascript/For protected resources, just make sure you validate the OAuthAccessor.
jay_soo