Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement an OAuth provider in Java?

I'm having a lot of problems trying to implement an OAuth provider.

I would like to know if anyone has successfully used an Oauth provider using Java? I found a lot of libraries but all of them are really bad commented and I cant work with them. I'm accepting any documentation that explains how an oauth provider should work and/or how implement it.

Situation: I have some data in MySQL on my server and I would like to authorize a "rely party" to access over OAuth, but I'm not sure how to do it.

like image 876
Winter Avatar asked Feb 20 '11 16:02

Winter


People also ask

How does OAuth work in Java?

One of OAuth's key patterns is a resource server. A resource server accepts an access token. If the token is valid, it gives a client access to the resource owner's data. In this example, a client is an app, the resource owner is a user, and the resource server is the Java API you develop.


2 Answers

I assume you want to secure your server-side services with Oauth? You did not say what kind of server-side technology you are using.

For example for REST-based servers, both Jersey and Resteasy already have Oauth integrated.

Also, this seem to be a pretty complete servlet+JSP OAuth example: http://oauth.googlecode.com/svn/code/java/example/oauth-provider/

like image 137
Peter Knego Avatar answered Oct 05 '22 00:10

Peter Knego


Here is a better alternative, It's in java and comes with demo dropwizard and Java EE applications

https://github.com/OpenConextApps/apis

like image 44
Rakesh Waghela Avatar answered Oct 04 '22 23:10

Rakesh Waghela