Have a small issue trying to create a facebook login : My callback is called right, (took the same as the doc say) but the problem is that an exception is thrown in the login_or_register() Auth_Opauth method.
I think I know why : The facebook answer to the callback contain a GET variable to return data whose name is 'code'. I looked in the Auth_Opauth and the callback method contain this :
// fetch the response and decode it
$this->response = \Input::get('opauth', false) and $this->response = unserialize(base64_decode($this->response));
So basically it look at Input::get('opauth', false) but in order to work it should be Input::get('code', false)
The problem come from my setup, or it's a change in facebook or something ?
The response from Facebook should be picked up by the opauth driver, which processes the facebook specific return values, and converts them into a standardized response. It then redirects and passes the info back to the Fuel driver using the GET variable 'opauth'.
If you check the int_callback() method of the Facebook strategy driver, you will see it will use $_GET['code'] and converts it.
Your callback method, the one that facebook redirects too after login, should contain:
// get the Opauth object $opauth = \Auth_Opauth::forge(false);
And it is that first line of code that handles the callback, and calls the Opauth facebook driver to unify the result and return it through a redirect. To do that, it uses this code:
So if your code follows the example (which comes from our own cms framework) you may need to verify your opauth configuration, because it seems either the facebook or the opauth redirect gets to the wrong place.