• Resolved bachmakm

    (@bachmakm)


    When I use the fb_connect method of the API to register a user via facebook, a response with status 200 is returned, but the response body is completely empty. There is no error message, no success message, just a null response.

    My Request Headers are as follows (where [omitted]… indicates that I’ve shortened/removed the value):

    GET /api/user/fb_connect/?access_token=CAAV2hZCaUgyYBANkY[omitted]... HTTP/1.1
    Host: www.myhost.com
    Connection: close
    User-Agent: Paw/2.1.1 (Macintosh; OS X/10.10.2) GCDHTTPRequest

    The response I receive looks like:

    HTTP/1.1 200 OK
    Date: Thu, 09 Apr 2015 17:47:58 GMT
    Server: Apache/2.4.7 (Ubuntu)
    X-Powered-By: PHP/5.5.9-1ubuntu4.6
    Set-Cookie: PHPSESSID=kba...[omitted]...ad6; path=/
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    X-Pingback: http://www.myhost.com/xmlrpc.php
    Content-Length: 0
    Connection: close
    Content-Type: text/html; charset=UTF-8

    I’ve followed the steps as listed here, including setting the email permission and approving app access, however I still receive an empty response. Is there something on the server side that I need to configure before using fb_connect? Any help is greatly appreciated.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter bachmakm

    (@bachmakm)

    In addition, I’ve tested my access_token using the facebook graph /me REST endpoint and the response is fine.

    So https://graph.facebook.com/me/?fields=id,first_name,last_name,email&access_token=CAAV2hZCaUgyYBANkY... returns a JSON object containing all of the specified fields with the correct values.

    Plugin Author Ali Qureshi

    (@parorrey)

    Hi,

    I tested with a valid access token and it worked just fine..
    try here: https://developers.facebook.com/tools/explorer/

    Make sure when you get access token for any fb app selected from top drop down, you do it with extended permissions and select email field.

    Also, when email is missing, it prints out this response..

    {"status":"ok","msg":"Your 'access_token' did not return email of the user. Without 'email' user can't be logged in or registered. Get user email extended permission while joining the Facebook app."}

    Thread Starter bachmakm

    (@bachmakm)

    Hey Ali,

    Thanks for responding so quickly and for verifying that the service was working on your end. The issue was that my server did not have the PHP cURL library installed. The fb_connect method was failing/exiting at the point of curl initialization and therefore was returning an empty 200 response. Once the cURL library was installed, this fixed the issue.

    As part of a future release, it may be beneficial to return an error in the event that cURL is not installed or refactor to make use of the WordPress HTTP API in lieu of cURL.

    Thanks again for the help!

    Plugin Author Ali Qureshi

    (@parorrey)

    thanks for reporting the actual issue.. I will also switch to WordPress HTTP API in next versions.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘fb_connect returning empty response’ is closed to new replies.