标头可能不包含多个标头,在Auth.php中检测到新行

时间:2017-04-17 13:56:22

标签: php facebook hybridauth

我目前正在uni中为我的项目实现社交帐户登录功能。

我已经通过编辑器安装了HybridAuth,并完全遵循HybridAuth网页上的指南。

我的代码:

...
else if (isset($_REQUEST["provider"])) {
// the selected provider
$provider_name = $_REQUEST["provider"]; // currently testing with only Facebook provider
try {
    // initialize Hybrid_Auth class with the config file
    require_once '../vendor/autoload.php';
    $config = array(
        "base_url" => 'http://localhost/project/vendor/hybridauth/hybridauth/hybridauth',
        "providers" => array (
            "Facebook" => array (
                "enabled" => true,
                "keys"    => array ( "id" => "xxxxxxx", "secret" => "xxxxxxx" ),
                "display" => "popup" // optional
            )));
    $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();
    echo $user_profile->displayName;
}
(Exception $e) {
....}
...

但后来我收到了这个错误,并没有将我重定向到Facebook认证页面:

enter image description here

Auth.php中的第367行:

if ($mode == "PHP") {header("Location: $url");}

任何指针?

0 个答案:

没有答案