SoC: OAuth - oauth.module -- sorry for late

Rob Loach - March 26, 2008 - 05:12
Project:Services
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:sumitk
Status:closed
Description

Implement OAuth, the open protocol to allow secure API authentication across the Services API. Might do well as a Summer of Code project.

#1

moshe weitzman - March 28, 2008 - 18:38

There is a PHP library at http://code.google.com/p/oauth-php/

#2

Rob Loach - March 29, 2008 - 19:44
Title:OAuth» SoC: OAuth
Category:task» feature request

Sumit Kataria has proposed this as a Summer of Code project. Very exciting!

#3

marcingy - March 30, 2008 - 02:11
Assigned to:Anonymous» marcingy

assigned as place holder

#4

sumitk - June 2, 2008 - 22:38
Component:Code» Miscellaneous
Assigned to:marcingy» sumitk

Work going on
patches to services coming soon
OAuth module is already in progress
http://drupal.org/project/oauth
OAuth services
http://drupal.org/project/oauth_services

#5

marcingy - June 2, 2008 - 18:20

#6

sumitk - June 18, 2008 - 15:55

Files in tar :
1. services.module and
2. services_admin_browse.inc

These are changed to use OAuth for authorization in services
right now only access token is checked against consumer key
Soon support for nonce and nonce_timestamp will be added
nonce_timestamp will be checked for calls as request timestamp >= token issue timestamp
So that all fake calls can be identified

Also a module outh_call is in development to make calls to server from Drupal only to obtain request and access token

Both files in tar are to be dumped in root dir of Services module
Then in settings check OAuth to use OAuth for calls

right now you can use a test client server http://tut2tech.com/sb4/oauth_test/ for making calls and obtaining request and access tokens
(that may not respond correctly - right now just issuing request token - will be fixed very soon)

#7

sumitk - June 18, 2008 - 01:03
AttachmentSize
services_files_modified.tar_.gz 6.4 KB

#8

sumitk - June 18, 2008 - 01:25
Component:Miscellaneous» Code
Status:active» postponed (maintainer needs more info)

needs suggestions to make this implemented best way

I explain more about OAuth request here :
to make a request via OAuth for services required parameters are :

string oauth_consumer_key (required)
OAuth key for consumer.
string oauth_token (required)
OAuth token for consumer.
string oauth_signature_method (required)
OAuth signature method.
string oauth_signature (required)
OAuth signature.
string oauth_timestamp (required)
OAuth call timestamp
string oauth_nonce (required)
OAuth call nonce

Here we will be verifying 1. access token against consumer key(oauth_token table) 2. nonce, nonce_timestamp against oauth_nonce table [these are still to fix in OAuth module]
Timestamp in request must be >= previous timestamp for access

#9

drewish - June 18, 2008 - 03:30

subscribing... here's sumit's changes as a patch.

AttachmentSize
services_238814.patch 5.34 KB

#10

drewish - June 18, 2008 - 03:30
Status:postponed (maintainer needs more info)» needs review

#11

sumitk - June 19, 2008 - 05:25
Title:SoC: OAuth» SoC: OAuth - oauth.module -- fixed many things now

Hi
here I am attaching modified oauth.module file
Please rename it and place it in /sites/all/modules/oauth/ directory

Issues Fixed :
1. Earlier it was not producing keys for all users, it was overwriting those -- >> Issue fixed
2. Nonce table was not able to store values in proper format -- >> Method + issue fixed
3. Earlier only users can view their keys+ secrets -->> issue fixed -->> Now admin(keys of all users) + users both can view their keys
4. Earlier normal user was not able to get an "access" token -->> issue fixed in this attached file -->>

you can use testing server for test calls -->> http://term.ie/oauth/example

Now we can use timestamp + nonce for verification of users in Services API as it is working fine now :)

AttachmentSize
oauth_fixed.module.tar_.gz 2.87 KB

#12

adrian - June 19, 2008 - 06:15

committed your fixes.

#13

sumitk - June 19, 2008 - 19:03

Patch to above oauth.module fixes

#14

sumitk - June 19, 2008 - 19:07

somehow it didnt got attached

AttachmentSize
oauth_.patch 3.64 KB

#15

sumitk - June 28, 2008 - 03:32

another issue link with major details to project
OAuth test browser done :)
check it here http://tut2tech.com/sb2/?q=admin/build/oauth
http://drupal.org/node/275107#comment-899622

#16

sumitk - August 23, 2008 - 11:25

Here is patch to srevices module to work with oauth module http://drupal.org/node/291571

#17

brmassa - August 29, 2008 - 11:18

Sumit,

niiice work. Im excited to commit work code, but i need the latest files and patches. I suggest you to update your CVS, since i did several changes in the past 2 days. Then post here the final code that i should test and commit, right?

regards,

massa

#18

marcingy - August 29, 2008 - 21:23

Sumit

I want to review the code aswell before any commit takes place aswell.

Marc

#19

sumitk - September 5, 2008 - 11:30
Title:SoC: OAuth - oauth.module -- fixed many things now» SoC: OAuth - oauth.module -- sorry for late

Hi Guys
my exams were going on - so I was a bit busy with them
I will submit latest code as earliest as possible

Also a few extra features have been added to module now - But I will add those to next big release
For testing purpose this code is working fine

ill update it this weekend surely and release a new patch for services as well

cheers!!
sumitk
http://sumitk.net

#20

sumitk - September 5, 2008 - 11:30

Hi Guys
my exams were going on - so I was a bit busy with them
I will submit latest code as earliest as possible

Also a few extra features have been added to module now - But I will add those to next big release
For testing purpose this code is working fine

ill update it this weekend surely and release a new patch for services as well

cheers!!
sumitk
http://sumitk.net

#21

brmassa - September 5, 2008 - 19:11

Sumit,

hi there! About 2 days ago i started to integrate OAuth on Services. I used your code as base.

Its 80% done!

It creates request and access tokens, create consumer keys for users that are allowed, and its already working with services calls. There are a couple things that i need to do before release it to the public, probably by monday. I suggest you to take a look on D6 Services CVS.

thanks for all that code.

regards,

massa

#22

marcingy - September 6, 2008 - 04:26
Status:needs review» needs work

Summit

That sounds good I'll be more than happpy to review what you have done at some point over the weekend.

Good luck with the exams.

Marc

#23

Hugo Wetterberg - June 8, 2009 - 14:33
Status:needs work» closed
 
 

Drupal is a registered trademark of Dries Buytaert.