【发布时间】:2016-11-18 16:03:27
【问题描述】:
我对 HybridAuth 有以下问题:
假设我从“http://dev.EXAMPLE.COM/login.php”页面开始。
我现在有以下脚本:
require_once('hybridauth/config.php');
require_once( "hybridauth/Hybrid/Auth.php" );
$hybridauth = new Hybrid_Auth( $config );
$adapter = $hybridauth->authenticate( $provider);
$user_profile = $adapter->getUserProfile();
它应该只是重定向到 Facebook/Google/Twitter,然后转到 HybridAuthindex.php,该过程应该在此处完成,然后重定向回我开始的页面(“http://dev.EXAMPLE.COM/login.php”)。
我现在唯一的问题是,它重定向到“https://...”而不是“http://...”,这不起作用,因为我没有 ssl 证书在我的开发服务器上,所以浏览器只会显示一个错误。
如何解决此错误?如何让HybridAuth 重定向到正确的 http://... 页面?
config.php:
<?php
$config = array(
"base_url" => "http://dev.XYZ.COM/hybridauth/",
"providers" => array (
"Google" => array (
"enabled" => true,
"keys" => array ( "id" => "XYZ", "secret" => "XYZ" ),
),
"Facebook" => array (
"enabled" => true,
"keys" => array ( "id" => "XYZ", "secret" => "XYZ" ),
),
),
"debug_mode" => false,
"debug_file" => "",
);
P.S.:我也尝试将 "trustForwarded" => 1 添加到配置中,但它也不起作用。
【问题讨论】:
标签: php login facebook-login hybridauth google-plus-signin