1

I'm asking you for help, because I can't understand what I'm doing wrong. I was trying to make secondary user authentication by Facebook for my application.

I had done everything according to this blog entry: http://thinkdiff.net/facebook/php-sdk-3-0-graph-api-base-facebook-connect-tutorial/

and once verification went fine and since another time I have error: "An error occurred. Please try again later."

I can't even get cause of error or any message. Everything seems to be OK. But I can't get through verification. When i use FB loginUrl i redirects me to error.

This is my FB code:

var $fbconfig = array(
        'appId' => '1234567890',
        'secret' => '12345678901234567890',
        'baseurl' => "http://xxxx.xx",
        'fbLoginSuccess' => "http://xxxx.xx/xx/xxxx",
        'cookie' => true
     );

        $facebook = new Facebook(
                        array(
                                'appId' => $fbconfig['appId'],
                                'secret' => $fbconfig['secret'],
                                'cookie' => $fbconfig['cookie'],
                        )
                );
        $userFB = $facebook->getUser();
                if ($userFB) {
                    $logoutUrl = $facebook->getLogoutUrl();
                } else {
                    $loginUrl = $facebook->getLoginUrl(
                            array(
                                    'scope'         => 'email',
                                    'redirect_uri'  =>  $fbconfig['fbLoginSuccess']
                            )
                    );
                }

I had found a way to receive answer through redirect_uri with err_msg variable. And then found a solution here: http://developers.facebook.com/bugs/112163982233944

23kulpamens
  • 652
  • 1
  • 7
  • 14

2 Answers2

1

I had found a way to receive answer through redirect_uri with err_msg variable. And then found a solution here: http://developers.facebook.com/bugs/112163982233944. I didn't notice that I had turned sandBox mode "on"

23kulpamens
  • 652
  • 1
  • 7
  • 14
0

I'm sure everybody's situation is a bit different. But for me, I was using php-sdk and got the message when I clicked the "Login to Facebook" link from the example script.

The issue resolved after I updated the 'appID' and 'secret' and then pushed the change back to heroku (i.e. - 'git push heroku master')

The key is not to forget to push the changes back to heroku master. Very easy to overlook if you're use to testing on localhost.

Hope this helps.

edwinjue
  • 21
  • 1