codemonth.dk

One project every month - making stuff better ...

OAUTH_UTL first draft done

So this months project is an implementation of Oauth. I have now created a package that can create a request for temporary credentials in Oauth version 1.0, and have almost implemented authorize, access and resource calls as well.

I have tried to implement it in a way that is completely reusable inside of Oracle, so you can piece together the parts from Oauth that you need, and no more. So that means you can call each step in the Oauth workflow individually of the others, or you can piece together the different procedures to automate an entire Oauth flow.

The package is called oauth_utl, and to use it, you simply call:

begin
oauth_utl.oauth_setup;
oauth_utl.oauth_client_setup('consumer_key', 'consumer_secret', 'http://www.myoauthresource.com/test?a23=test');
oauth_utl.oauth_request_token;
oauth_utl.authorize;
oauth_utl.oauth_access_token;
oauth_utl.oauth_resource;
end;
/

As I said, currently only version 1 of Oauth is supported, but I'm slowly building support for 2.0. Next time I will show how to use the library against a real Oauth protected resource, such as Twitter and a Flickr Image.

Tagged in : DBMS_CRYPTO, DBMS_RANDOM, UTL_ENCODE, UTL_HTTP, UTL_I18N