Web Service for User Login

phrax - January 25, 2006 - 18:21
Project:Drupal
Version:7.x-dev
Component:base system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:patch (code needs work)
Description

This patch adds an authentication to drupal's web service so clients accessing xmlrpc.php don't always have to be Anonymous. Implementation is simple:

1. Client requests an authentication token, basically a session id
2. Drupal checks their crudentials (username/password) (system.getToken) and returns a token (same as a PHP session id). This is the same as a login through user/login, the current session id (Anonymous) becomes a user.
3. All subsequent requests sent by the web service client go to: /xmlrpc.php?token={session id}
4. xmlrpc.php was modified to recreate the session with the logged in user.

5. Unrelated, but felt compelled to fix. At the end of an anonymous xml-rpc request, the record from {sessions} is removed from the db. Not sure if this would break anybody's functionality, but it seems strange to me to keep that session id around.

AttachmentSize
xmlrpc_10.patch2.64 KB

#1

moshe weitzman - November 10, 2006 - 19:13

this looks like a reasonable implementation to me ... i don't like #5 since some modules rely on session data even for anon users.

#2

coreb - November 28, 2006 - 18:16
Version:x.y.z» 6.x-dev

#3

ivanfi - March 23, 2007 - 12:44
Version:6.x-dev» 5.1

I have tried to apply this patch on Drupal 5.1, but I had to make some small modifications to make it work. See the attached patch, which is an updated version of the original, although without item #5 of the original post.

AttachmentSize
xmlrpc_5.1.patch2.47 KB

#4

ivanfi - March 23, 2007 - 12:49
Version:5.1» 6.x-dev

I'm setting back the version to 6.x-dev, since I did not mean to make this a feature request for 5.1, just wanted to share the patch for Drupal 5.1 in case somebody needs it.

#5

catch - October 24, 2007 - 12:13
Version:6.x-dev» 7.x-dev
Status:patch (code needs review)» patch (code needs work)

No longer applies.

#6

moshe weitzman - October 24, 2007 - 12:19

Ideally Drupal will implement the new OAuth spec for this - http://oauth.net/

#7

Zothos - October 26, 2007 - 16:44

OAuth doenst seem to be ready at the moment. But its a real nice idea definitly something for drupal 7

#8

ankit_singh - June 10, 2008 - 06:57
Title:Adding authentication ability to drupal's web service» Web Service for User Login
Version:7.x-dev» 5.7
Component:base system» user system
Category:feature request» support request
Priority:normal» critical
Status:patch (code needs work)» active (needs more info)

Hi Guys

I am sorry I dont have so much deep knowledge in Technical like you guys.

I am currently facing 1 problem.

I am using Drupal 5.7 version now and i made 3 websites for different purposes but now i am thinking of making some web service in Java Which will provide a common login for all 3 websites.

Now i am reading about Service module but still cant figure it out how to implement it.

So is it possible to do like this and please can anybody guide me and how i should implement this patch??

Quick reply will be really appreciated.

Thanks to all in advance.

REgards

Ankit

#9

catch - June 10, 2008 - 08:49
Version:5.7» 7.x-dev
Component:user system» base system
Category:support request» feature request
Priority:critical» normal
Status:active (needs more info)» patch (code needs work)

Ankit, please don't hijack hijack old issues for new support requests. A list of places to find support can be found at http://drupal.org/support

#10

greg.harvey - November 27, 2008 - 14:04

This effort is being duplicated by the Services module, which doesn't seem sensible. Have you had a look at the User Service?
http://drupal.org/project/services

#11

moshe weitzman - November 27, 2008 - 14:07

It is quite common for functionality to start in Contrib and then find its way to core. Quite sensible, and common.

#12

greg.harvey - November 27, 2008 - 14:21

Oh, yes - I don't dispute that for an instant - but these seem to be separate efforts, not contrib becoming core...? I'm suggesting there could be some liaison with the Services guys - I'm not making any comment on development paths in general... just this one.

It might be that the Services guys can remove their login/logout methods from their D7 version, but if there's no communication and you're both building the same thing...! See my point?

 
 

Drupal is a registered trademark of Dries Buytaert.