Skip to content
ayoy edited this page Sep 13, 2010 · 5 revisions

What’s QOAuth?

QOAuth is a Qt-based C++ implementation of an interface to services using OAuth authorization scheme.

OK, but what’s the OAuth itself?

According to the OAuth Core 1.0 specification:

The OAuth protocol enables websites or applications (Consumers) to access Protected Resources from a web service (Service Provider) via an API, without requiring Users to disclose their Service Provider credentials to the Consumers.

Simply, OAuth is a way of connecting an application to the Service Provider’s API without needing to provide User’s login or password. The authorization is based on an exchange of a Token (user-specific) together with a Consumer Key (application-specific), encrypted with a combination of so called Token Secret and Customer Secret. Getting access to Protected Resources consists in three basic steps:

  1. obtaining an unauthorized Request Token from the Service Provider,
  2. asking the User to authorize the Request Token,
  3. exchanging the Request Token for an Access Token.

Details are covered in Section 6 of the OAuth 1.0 Core Specification. As the authorization procedure is quite complex, the QOAuth library helps to simplify it by doing all the dirty work behind the scenes.

Cool! I want to try it!

Dependencies

Note: KDE users can skip this paragraph :-)

Fine, all you have to do is install a few things before you could compile QOAuth library (often you already have installed most of them, if not all). Anyway, you will need:

  1. Qt libraries 4.4 at least, that’s for sure :)
  2. OpenSSL version 0.9.6 or newer (comes bundled with Linuxes and MacOS X, Windows users go here)
  3. QCA (Qt Cryptographic Architecture), available from Delta XMPP Project
  4. OpenSSL plugin to QCA, available from QCA homepage.

Installation

Once you have everything set up, get the QOAuth library sources from GitHub, and follow the well known procedure:

$ qmake
$ make
$ sudo make install

You’re done! Excuse me, Windows users, but I didn’t figured out the installation procedure for Windows yet…

Running

Add to your project file:

CONFIG += oauth

And to your source code:

#include <QtOAuth>

You can start playing up with QOAuth lib! Be sure to check out the full QOAuth documentation. Enjoy!