Getting a error when trying to login

When I tryied to login I keep getting this error:

Notice: Undefined property: stdClass::$data en fboauth_access_token() (line 292  ****/sites/all/modules/fboauth/includes/fboauth.fboauth.inc).

The Facebook login could not be completed due to an error. Please create an account or contact us directly. Details about this error have already been recorded to the error log.

plus this in watchdog messagge:

Facebook OAuth could not acquire an access token from Facebook. We queried the following URL:
https://graph.facebook.com/oauth/access_token?client_id=273882556016196&client_secret=**************************
. Facebook's servers returned an error 0:

Hope someone can help me.

Comments

quicksketch’s picture

I can access that URL just fine and it seems to be returning the expected values. I'm guessing that the error message is indicating that Facebook's authentication servers may have been down (that does happen more regularly than you might expect).

BTW, your posting of that URL in a public forum may have caused your site a significant security risk. You shouldn't ever share your "client_secret" value with anyone, which happens to be a part of that URL. I'd suggest creating a new app to make a new secret code.

quicksketch’s picture

Issue summary: View changes

watchdog

maynardo’s picture

I'm still getting the same error...

and you're rigth I shouldn't have posted the complete url... so i did create a new app but error remains, you can see it for yourself http://www.salechile.cl in the left bar is the facebook connect block.

maynardo’s picture

It's been a couple of days and the error remains the same, so I don't think the facebook servers are my problem, Can you think of anything else that could be happening ?

maynardo’s picture

Priority: Major » Critical

I tried deactivating the "email registration" module thinking it could conflict with the facebook username, but nop... the problem persists. My php version is 5.3.10. Please give some Ideas of could be wrong.

quicksketch’s picture

If you access the URL you posted above in a browser (putting back in your client_secret), can you see the returned access token? This doesn't seem to be a widespread problem, perhaps it's something unexpected like a blacklisting of your server by Facebook (just guessing here).

maynardo’s picture

yes, I get : access_token=************************&expires=5158426

Any ideas how could I find out if the server is blacklisted?

quicksketch’s picture

Any ideas how could I find out if the server is blacklisted?

It might be useful to temporarily insert debugging code into fboauth module to see exactly what is being returned from Facebook when your server tries to obtain an access token. Install the devel.module and then insert a call to dvm() in fboauth_access_token() like this:

  $query = array(
    'client_id' => $app_id,
    'client_secret' => $app_secret,
    'redirect_uri' => url('fboauth/' . $action_name, array('absolute' => TRUE, 'query' => !empty($_GET['destination']) ? array('destination' => $_GET['destination']) : array())),
    'code' => $code,
  );
  $token_url = url('https://graph.facebook.com/oauth/access_token', array('absolute' => TRUE, 'query' => $query));
  $authentication_result = drupal_http_request($token_url);

  dvm($authentication_result); // <-- Add this line

Then try to login through FBOAuth. That will give you the full output of what your server is getting back from Facebook and you can see if Facebook returned something that could be used to determine what's going wrong.

quicksketch’s picture

Oh, of course something that hadn't occurred to me at all. Make sure your server can actually make HTTP requests to other servers. If your server can't make an HTTP request, then it's not going to work with FBOAuth. The drupal_http_request() function that FBOAuth uses internally uses fsock() to connect to other servers. You might check with your hosting provider to confirm that fsock() connections are allowed on your server.

maynardo’s picture

Great, thanxs a lot . The problem was in my php.ini since I needed to enable the "extension=openssl.so" . Hope this helps somebody in the future.

Best Regards

quicksketch’s picture

Status: Active » Fixed

Great, glad we figured that one out.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

adaddinsane’s picture

Just to confirm that I hit the same problem with openssl.so not being enabled - I'm glad someone had the problem before me otherwise it could have been a long hard road. (I would *never* have thought of that.)

dewolfe001’s picture

I have openssl and fsock enable I cannot authorize--

{"error":{"message":"This IP can't make requests for that application.","type":"OAuthException","code":5}}

any ideas what I could be missing?

I have registered my app at Facebook and there is something I could be missing there (I doublechecked the IP whitelist, etc.)

Thanks in advance!

maurocampi’s picture

Hi! I have the same problema. I have enabled both openssl and fsock().
I tried restarting my secret api key but the error stills persists.
______________________________________________________________________________________________________________
The Facebook login could not be completed due to an error. Please create an account or contact us directly. Details about this error have already been recorded to the error log.

UBICACIÓN http://www.comunidadrt.com.ar/fboauth/connect?code=xxxxxxxxxxxxxxxxxxxxx...

MENSAJE Facebook OAuth could not acquire an access token from Facebook. We queried the following URL:
https://graph.facebook.com/oauth/access_token?client_id=xxxxxxxxxxxxxxxx...
. Facebook's servers returned an error Connection timed out:
(no data returned)

______________________________________________________________________________________________________________

what can I try?

maurocampi’s picture

Issue summary: View changes

remove adress