Sumit Kataria is a Google of Code student working on implementing a OAuth Server for the Services module. For some information about what he's working on and how OAuth works, visit OAuth General Information.

He has done a fantastic job so far in integrating OAuth into Drupal and needs to make some small modifications to Services core. He will create patches and upload them here, if you think they are good, feel free to give him commit access.

CommentFileSizeAuthor
#4 services.patch8.88 KBsumitk
#2 services+oauth_08_08_08.tar_.gz40.76 KBsumitk

Comments

sumitk’s picture

Assigned: Unassigned » sumitk

patch coming very soon for services to work with OAuth -
OAuth module is to work with Services only, you can checkout a copy from CVS to make a test

sumitk’s picture

StatusFileSize
new40.76 KB

Hi all

OAuth and Services (to work with OAuth) are now ready for a release

I am attaching a tar containing both modules here

robloach’s picture

Status: Active » Needs work

Mind sticking it in a patch?

sumitk’s picture

Title: Services CVS Access for Sumit K? » Services CVS Access for Sumit K? - patch for services to work with OAuth
StatusFileSize
new8.88 KB

Hi
here is patch for services to work with OAuth module
Please download latest oauth module from cvs to work with - a video coming soon showing how to use this module in detail
Basic details of OAuth module is on http://sumitk.net and soc-2008 project wiki page

sumitk’s picture

Component: Miscellaneous » Code
Priority: Normal » Critical
Status: Needs work » Needs review

HI guys
summer of code is ending we need to review this patch for services - to work with OAuth system and oauth module in drupal

marcingy’s picture

Status: Needs review » Needs work

Hi Sumit

I have just done a quick review of your patch.

By my understanding the idea is that a service uses the existing API keys or the Oauth keys. As a result selecting to use Oauth should be implemented as a radio button, with the other option being the key api, rather than a checkbox.

What version of code was this patch generated against? It looks as if the patch was done on code retrieved from 6 head but then the patch itself was generated against the current release version of services.

The functions check_nonce and lookup_nonce code be tidied up. They could indeed be combined into one function e.g

function check_nonce($nonce, $timestamp) {/*{{{*/
    // verify that the nonce is uniqueish
    $found = lookup_nonce($nonce, $timestamp);
    if (db_result(db_query("SELECT count(*) FROM {oauth_nonce} WHERE nonce_timestamp='%s'", $timestamp))) {
      return FALSE;
    }
    else{
      db_query("INSERT INTO {oauth_nonce} (nonce, nonce_timestamp) VALUES ('%s', %d)", $nonce, $timestamp);
      return TRUE;
    }
}

Also shouldn't nonce be included in DB query as there could be muiltiple timestamps the same?

Your code also has tabs within in it when it should be spaces and there are some other style errors in the code. Using the coder module will help you quickly correct style errors.

Otherwise looks good

Marc

brmassa’s picture

Status: Needs work » Closed (duplicate)

Guys,

i will mantain the OAuth discussion on http://drupal.org/node/238814, right?

regards,

massa

sumitk’s picture

Status: Closed (duplicate) » Active

nice #238814 is right place for it now

marcingy’s picture

Priority: Critical » Normal
marcingy’s picture

Status: Active » Closed (fixed)

As seperate ticket exists