我使用HybridAuth扩展程序以登录为Facebook。 在Hybrid Auth中导致错误的代码如下:
try
{
$path1 = Yii::getPathOfAlias('ext.HybridAuth');
require_once ($path1 . '/hybridauth-' . HybridAuthIdentity::VERSION . '/hybridauth/Hybrid/Auth.php');
$config = $path1 . '/hybridauth-' . HybridAuthIdentity::VERSION . '/hybridauth/config.php';
// initialize Hybrid_Auth with a given file
$hybridauth = new Hybrid_Auth( $config );
// try to authenticate with the selected provider
$adapter = $hybridauth->authenticate( $provider_name );
// then grab the user profile
$user_profile = $adapter->getUserProfile();
}
catch(Exception $e)
{
}