How i can popuplate user's facebook data into my built-in drupal register form? How can I populate an authorized user's Facebook data into my Drupal registration form?
Note: user is authorized from my Facebook application and allowed my Facebook app to access his data.

Update: I am using Drupal for Facebook, and to populate the user info I am implementing fb_form_alter inside fb.module. My code is 

function fb_form__alter(&amp;$form, &amp;$form_state, $form_id) {
if(!($form_id == 'user_register_form')) {
return;
}
if ($GLOBALS['_fb'] &amp;&amp; $fbu = fb_get_fbu($account)) { // @TODO - is fb_get_fbu() a performance hit here?
    try {
      $data = fb_fql_query($GLOBALS['_fb'], "SELECT name FROM user WHERE uid=$fbu", array(
                             'access_token' =&gt; fb_get_token($GLOBALS['_fb']),
                           ));
      if (count($data) &amp;&amp; isset($data[0]['name'])) {
        $form['account']['name']['#default_value'] = $data[0]['name'];
      }
    }
    catch (Exception $e) {
      fb_log_exception($e, t('Failed to alter username for facebook user %fbu', array(
                               '%fbu' =&gt; $fbu)));
    }
}
}


I put the above code after the form_username_alter() function but with no success :(
The Dupal for Facebook module kind of does the trick.

The problem is that it uses soon to be deprecated FB APIs, and it isn't exactly Drupal 7 ready yet (though it's very well maintained and I am sure it'll catch up soon), so you might as well want to write your own module from scratch. These are the basic info you should check if you want to get into this


Get user Authentication and Permissions. (You will
probably need to also look into offline_access permissions.)
Access to the FB user object using the PHP SDK for Basic profile informations. It is session based, so you can access it from anywhere in your site, for instance to pre-populate you registration form. (Don't forget to include the PHP SDK to your script.)
Access or write other user data (e.g., activities, picture, wall feed) via the Graph API.