0

I have been working on this for the past two days trying to get the facebook authentication using HybridAuth to work in codeigniter using https://github.com/andacata/HybridIgniter integration. The twitter authentication works fine but i get a user User has cancelled the authentication or the provider refused the connection when i try authorizing with facebook. When i directed to facebook from the site, it reads in the url that user has denied the application even before i enter my facebook details. This then return an empty user id to the application.

2 Answers2

1

It may be because Twitter is using Oauth1.0 while Facebook is using Oauth 2.0 for authentication. May be settings are not correct in your project.

SRana
  • 125
  • 1
  • 12
0

When the authentication fail, you should call logout method.

$provider->logout();

then redirect again to the hibridy login. So all Cookies and Session var are reset and the user should be able to re-authorize the app.

Luca Rainone
  • 16,138
  • 2
  • 38
  • 52