我正在使用HybridAuth Yii扩展通过Facebook等登录。但我想这不是 Yii 的问题,所以简单的 PHP 开发人员也可以帮助我。
如果我取消连接,我将被重定向到一个页面,其中只会显示以下错误:
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
我已经尝试禁用Facebook的沙盒模式,并尝试在Facebook开发人员页面上找到"取消"重定向URL,但它仍然不起作用。
是否有可能重定向到我的应用程序主页 URL 或类似的东西?
您可以找到的最接近"取消"重定向的内容是"取消授权回调URL",您可以在应用程序下的Facebook开发人员页面上的Settings -> Advanced -> Deauthorize Callback URL
下设置该URL下。