Hi,
I have enable option to create local user and to map his account with facebook.
When user create account his name in his profile looks like 231312434@facebook, but under comments section and admin user list I can see full names. But I have different question. When user go to EDIT he can see empty email and password field. So account are not mapped properly or I don't understand this map account feature. Is there any way to obtain email and password from user facebook when using connect just to transfer it to user drupal account?
Thanks

Comments

ferdi’s picture

chazz, the this suite of modules does not support "map account" as you describe above. It's clear that you are using some other fb modules.

chazz’s picture

Project: Facebook social plugins integration » Drupal for Facebook
Version: 6.x-1.0-alpha4 » 6.x-2.0-rc2

Sorry, moved to Drupal for Facebook

Dave Cohen’s picture

You can't learn the email unless the user grants the email extended permission. In 2.x this happens after the account is created. There's no easy way to update the user account with this info.

you never learn their facebook password.

gabash’s picture

i have an app with the "email extended permission", still even when a new account is created i only get the name and facebook ID but the email field on the local user account is empty.

dipen chaudhary’s picture

I can confirm that extended permissions do not work for me either, I have e mail checked in both extended permissions and prompt user for extended permissions in the application settings, Also I have require login enabled, but when it does show the authorization page, it doesnt ask for extended permissions, just ask for basic profile data permissions. Upon Clicking authorization it redirects the user to myserver.com/callback_url which is a totally diff issue altogether :( #884642: Hard redirect to myserver/callback url after app authorization.

My understanding of it:

PHP Way:
The facebook api package I have doesn't take parameters in require_login which is actually the php way to ask for extended permissions - http://forum.developers.facebook.net/viewtopic.php?pid=241792#p241792 apparently pear lib of php has that covered atleast thats what i have found in my finding about.

DFF Way - JS

How DFF does it is via JS :


function fb_permission_fb($op, $data, &$return) {
  if ($op == FB_APP_OP_EVENT) {
    if ($data['event_type'] == FB_APP_EVENT_POST_AUTHORIZE) {
      // User has authorized the application.
      $fb_app = isset($data['fb_app']) ? $data['fb_app'] : NULL;
      $fb_app_data = fb_get_app_data($fb_app);
      $fb_permission_data = $fb_app_data['fb_permission'];
      
      if (is_array($fb_permission_data['prompt'])) {
        $perms = array();
        foreach ($fb_permission_data['prompt'] as $key => $value) {
          if ($value) {
            $perms[] = $key;
          }
        }
        if (count($perms)) {
          // http://wiki.developers.facebook.com/index.php/JS_API_M_FB.Connect.ShowPermissionDialog
          $js = "FB.Connect.showPermissionDialog('" . implode(',', $perms) . "')";
          fb_connect_init_js($js); // Add javascript to the next page.
        }
      }
    }
  }
}

But since due to #884642: Hard redirect to myserver/callback url after app authorization. I never see the next page.

@Gabash -- Can you please confirm if you are redirected to apps.facebook.com/your-app after u have authorized the app, look at #884642: Hard redirect to myserver/callback url after app authorization.

dipen chaudhary’s picture

I am gonna try it now, but how about using the pear lib php package and using require_login('perm1,perm2') in:

fb_canvas.module Line 115

if ($is_canvas) {
      // We are serving a canvas page.
      $conf['admin_theme'] = $custom_theme;
      
      if ($fb_canvas_data['require_login'] == FB_CANVAS_OPTION_REQUIRE_LOGIN) {
        // The application is configured to require login on all canvas pages.
        // However, there are exceptions.
        if (fb_is_profile_tab()) {
          // Redirects are not allowed for the profile tab.
        }
        else {
          // There may be other exceptions, for example some ajax callbacks.  Potential todo item.
          $fb->require_login();
        }
      }

Dave Cohen’s picture

What I tried to explain before is that in 2.x (older facebook libs) it's extremely difficult to prompt for extended permission as soon as the user authorizes.

If you need this feature, you're way better off upgrading to 3.x. Facebook has changed it around a lot, to make this much easier to do.

konrad1811’s picture

Just forget about password :P

Email possible - read forward.

I actually moved to FBoauth module - why?
- e-mail maping.

If I logged in to my site (using "FB login" on my site) there was no e-mail request and no email address was passed to Drupal after user first login [and after too].

However if I logged in from Facebook site (using "Go to app" button from FB aplication site) it was ok - email passed !!! xD.

Resume - not relevant functionality and this still needs some work.

Email [and all Facebook connect staff] you get easy using this module: http://drupal.org/project/fboauth

Would be nice if both developers joined forces for one extended module :)

Regards