Archive for October, 2013

Oct 3 2013

Implement your 2-legged OAuth server with Java Restlet

In the previous post we’ve been looking into how we can implement a simple Java client to access resources protected via 2-legged OAuth.
This time we’ll focus on the server side code needed to develop a 2-legged OAuth server that enables your REST API’s resources to be protected with the same method.

In order to do so, we’ll use Restlet, a Java framework to create RESTful web services, and again Scribe, the simple OAuth Java library for the validation part. The code presented here has been tested and is ready to be used in your Restlet application.


Globetrotter Software Engineer. I try to conjugate where the ambitions lead me with an environment that makes me feel happy. I love sun and sea. My mind is always spinning, for good and for bad. I enjoy traveling and experiencing new places by being constantly surprised by things I would have never even conceived.