3rd party login

psi-borg - September 16, 2009 - 04:19
Project:Services
Version:6.x-2.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed
Description

i'm using the following modules to test out flash app for facebook, using drupal services:

fb
amfphp
services

when a facebook user visits the application driven by my drupal site, fb automatically creates a local drupal user account mapped to the facebook account. i could call the service function user.login() to have the facebook user login, but that would be redundant since the user is already logged into drupal - however, the user is NOT logged into drupal services.

how do i reconcile drupal and drupal services logins so that the facebook user does not have to needlessly login twice?

#1

marcingy - September 16, 2009 - 04:21
Status:active» won't fix

We don't support any none core drupal technology, might be worth moving the issue to the facebook queue but given that facebook interaction is javascript driven you will likely have to create a custom service.

#2

psi-borg - September 17, 2009 - 00:17
Status:won't fix» active

i tried to simply modify the user service without success...

if i have in my facebook template

foreach ( $_SESSION as $ind=>$val )     echo "session: $ind : $val <br />";

the session variable fb_sig_user will echo a valid facebook uid. however,

if i edit services/user_service.inc::user_service_login() at about line 80, replacing

$user = user_authenticate(array('name' => $username, 'pass' => $password));

with (yeah this is broken code, point being that $_REQUEST['fb_sig_user'] is not eval'd as TRUE)

if ($_REQUEST['fb_sig_user']){
  $query = "SELECT uid FROM authmap WHERE authname like '%d\%'";
  $result = db_query($query, $_REQUEST['fb_sig_user']);
  $row = db_fetch_object($result);
  $user = user_laod($row->uid);
   return services_error(t('inside fb_sig_user block.'));
  }else{
  $user = user_authenticate(array('name' => $username, 'pass' => $password));
  }

...$_REQUEST['fb_sig_user'] is not evaluated as TRUE and the $user object doesn't get returned.

what am i missing here?

#3

marcingy - September 16, 2009 - 15:30
Status:active» won't fix

Please do not reopen this issue as I say facebook integration is not supported by the services team.

#4

psi-borg - September 17, 2009 - 00:14

idk if you may want to reconsider your last... i would predict that most drupal site accounts will be created/logged into through 3rd party authentication systems, like openID and OAuth, through which users have primary accounts at Google, Yahoo, Facebook or Twitter... and like the big boys, either drupal will adapt to interoperability standards, which (importantly) includes authentication systems... or it will go the way of the dinosaurs and become extinct.

a principal component of the recent success of the behemoths listed above is that they all have services api's and flexibility in how other sites access their services.

#5

marcingy - September 17, 2009 - 00:21
Status:won't fix» active

If you need this kind of functionality why not create your own login service that provides the ability to integrate with drupal services module. I'm not saying that some sort of support should not be provided but such a module won't live within the services package. The aim is actually to silm down services so as it is only a framework #smallcore if you will. Of course that will take time, as a result we don't want to accept any more crud into the framework.

At the same time I understand your needs to try and find answer to your issue so I'll reopen - another place that you might want to post is on the services group on d.o as that is more general in terms focus whereas we try to make sure tickets that are on the services queue are actually issues that we need to resolve rather than cases that have the potential to go unanswered for ever.

#6

heyrocker - November 24, 2009 - 03:41
Status:active» postponed

I do not discount the need for such services, but it is not going to happen in the current branch. I'm not sure if Facebook uses oAuth, but if it does I recommend looking at oauth_common and services_oauth.

I assume we will look more into these features in the next branch, so I'm moving this to postponed for the time being.

 
 

Drupal is a registered trademark of Dries Buytaert.