PHP HybridAuth Authentication failed - wrong redirect

858 views Asked by At

I am using HybridAuth Yii extension to login via Facebook etc. But I guess it isnt a Yii problem, so plain PHP developer could help me out aswell.
If I am canceling the connection I am getting redirected to a page, where only the following error will be shown:

Authentication failed. The user has canceled the authentication or the provider refused the connection.

Original error message: Authentication failed! The user denied your request.

Trace:
#0 /var/www/dev/protected/extensions/widgets/hybridAuth/vendors/hybridauth/Hybrid/Auth.php(39): Hybrid_Auth::initialize(Array)
#1 /var/www/dev/protected/extensions/widgets/hybridAuth/CHybridAuth.php(70): Hybrid_Auth->__construct(Array)
#2 /var/www/dev/protected/extensions/widgets/hybridAuth/CHybridAuth.php(80): CHybridAuth->getHybridAuth()
#3 /var/www/dev/protected/extensions/widgets/hybridAuth/CHybridAuth.php(155): CHybridAuth->getAdapter('Facebook')
#4 /var/www/dev/protected/controllers/HybridauthController.php(21): CHybridAuth->isAdapterUserConnected('Facebook')
#5 [internal function]: HybridauthController->actionAuthenticate('Facebook')
#6 /var/www/dev/yii/framework/web/actions/CAction.php(108): ReflectionMethod->invokeArgs(Object(HybridauthController), Array)
#7 /var/www/dev/yii/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(Object(HybridauthController), Object(ReflectionMethod), Array)
#8 /var/www/dev/yii/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#9 /var/www/dev/yii/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#10 /var/www/dev/yii/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#11 /var/www/dev/yii/framework/web/CWebApplication.php(282): CController->run('authenticate')
#12 /var/www/dev/yii/framework/web/CWebApplication.php(141): CWebApplication->runController('hybridauth/auth...')
#13 /var/www/dev/yii/framework/base/CApplication.php(180): CWebApplication->processRequest()
#14 /var/www/dev/index.php(13): CApplication->run()
#15 {main}


Fatal error: Call to a member function isUserConnected() on a non-object

I already have tried disable Facebooks Sandbox Mode as well as trying to find a "on cancel" redirect url at the Facebook developers page, but it still doesnt work.
Is there any possibility to redirect to my applications home URL or something like that?

1

There are 1 answers

0
StorytellerCZ On

The closest thing you can can find to the "on cancel" redirect is "Deauthorize Callback URL", which you can set under Settings -> Advanced -> Deauthorize Callback URL on the Facebook developer page under your app.