Vishwanath Krishnamurthi's blog

A blog on Java EE, clean code, open source and TDD

SignPost + Maven for OAuth

leave a comment »

SignPost is an easy-to-use Java library to sign HTTP messages for OAuth. (Here’s a little intro if you cared) I don’t know why but the term ‘OAuth’ sounded pretty complex to me initially. Well, it probably is. But with signpost it doesn’t take you more than ten minutes to set it all up.

The examples here are pretty straight-forward. If you were looking for maven dependencies, here it goes-

    <dependency>
      <groupId>oauth.signpost</groupId>
      <artifactId>signpost-core</artifactId>
      <version>1.2</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>oauth.signpost</groupId>
      <artifactId>signpost-commonshttp4</artifactId>
      <version>1.2.1.1</version>
    </dependency>

As for httpcomponents,  version #4.1.1 works pretty well along with signpost 1.2

<!--  Apache commons compatible with signpost -->
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.1.1</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
      <version>4.1.1</version>
      <scope>compile</scope>
    </dependency>

Note:

  • While using httpcomponents library, use CommonsHttpOAuthConsumer instead of DefaultOAuthConsumer
Advertisements

Written by Vishwanath Krishnamurthi

June 8, 2011 at 8:22 pm

Posted in Other Frameworks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: