Hello,
My eyes are killing me with trying to find suitable syntax for getting email from Facebook login.
With email, i can fetch the correct access-rights to go forward in my web-page.

Maybe you can help a little about?

A lot of people say same. Put the parameter in comma-separated line in code.
Yes, but they all have as many kind of version code as threads.

base_facebook.php includes this section. As i am newbie for this functionality, started to learn today, cannot see the correct place to add "email" to it.
Login is working fine in common, and result of logout, gives token out for redirect page. But that is not yet enough for it without email.

  /**
   * Get a Login URL for use with redirects. By default, full page redirect is
   * assumed. If you are using the generated URL with a window.open() call in
   * JavaScript, you can pass in display=popup as part of the $params.
   *
   * The parameters:
   * - redirect_uri: the url to go to after a successful login
   * - scope: comma separated list of requested extended perms
   *
   * @param array $params Provide custom parameters
   * @return string The URL for the login flow
   */
  public function getLoginUrl($params=array()) {
    $this->establishCSRFTokenState();
    $currentUrl = $this->getCurrentUrl();

// if 'scope' is passed as an array, convert to comma separated list
$scopeParams = isset($params['scope']) ? $params['scope'] : null;
if ($scopeParams && is_array($scopeParams)) {
  $params['scope'] = implode(',', $scopeParams);
}

return $this->getUrl(
  'www',
  'dialog/oauth',
  array_merge(array(
                'client_id' => $this->getAppId(),
                'redirect_uri' => $currentUrl, // possibly overwritten
                'state' => $this->state),
              $params));
  }

  /**
   * Get a Logout URL suitable for use with redirects.
   *
   * The parameters:
   * - next: the url to go to after a successful logout
   *
   * @param array $params Provide custom parameters
   * @return string The URL for the logout flow
   */
  public function getLogoutUrl($params=array()) {
    return $this->getUrl(
      'www',
      'logout.php',
      array_merge(array(
        'next' => $this->getCurrentUrl(),
        'access_token' => $this->getUserAccessToken(),
      ), $params)
    );
  }

    For more info,
    In config, there is "$fbPermissions = 'email'; //Required facebook permissions",
    But with session i get only code, appid and user_id:
    $SESSION['fb'.$appId.'_user_id'];

    So i can fetch all user information from database, but i assume, i need more session variables, that they can stay active with changing pages in site.

      Caveat: I've never worked with Facebook logins/permissions/etc.

      Anyway, just to clarify, I'm not sure if you're asking how to submit an already known email address as part of the request you are sending to FB, or are you asking how to get them to return the current user's email address? (If the latter, do they do that? If so, I might want to make sure I never log in to non-FB sites using my FB login. :eek: )

        My system permissions works with user-table access values. So i need session to work with user session values, like email-address, what is unique.
        Yes, your email can be fetched with facebook-logins. I currently read it with information of Facebook ID. Facebook creates a user-account to user-database, with all information.
        So i just fetch email with matched ID generated in session. It is visible when asking session info.

        I just started to think, where do i need this login. If i promise, that i do not collect any commercial information from users, with cookies etc.

        I liked to have simple login for users, that why tried facebook-login also. I sleep over the night and decide this tomorrow :-D

          Decided to leave facebook-login out. ;-)
          Case solved...

            Write a Reply...