PHP HybridAuth社交登录根本不起作用.重定向到?hauth.start = Facebook& hauth.time [英] PHP HybridAuth social signin not working at all. Redirecting to ?hauth.start=Facebook&hauth.time

查看:111
本文介绍了PHP HybridAuth社交登录根本不起作用.重定向到?hauth.start = Facebook& hauth.time的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在这个简单的php网站上使HybridAuth Social Login工作.下载并安装HybridAuth.然后发现,即使是这些示例也不适用于社交登录(也在远程服务器上尝试过.

I was trying to make HybridAuth Social Login work on this simple php site. Downloaded HybridAuth and installed it. Then found that even the examples does not work for social login (tried on remote server too.

正常的signin_signup示例可以正常工作.但是,每当我单击链接登录到社交网络(即Facebook,Twitter)时,它都会将我重定向到(MY_BASE_URL/index.php?hauth.start = Facebook& hauth.time),而不显示任何登录窗口/错误消息

The normal signin_signup example works fine. But whenever I click the link to login to a social network (i.e, facebook,twitter) it redirects me to (MY_BASE_URL/index.php?hauth.start=Facebook&hauth.time) without showing any login window/error messages at all.

我已经仔细阅读了此处发布的文档和其他解决方案.调整了我的config.php以使其具有基本网址,例如 http://example.com/index.php .但是它只是没有回应.有什么我想念的吗?我已经花了2天了.

I've carefully read the documentations and other solutions posted here. Adjusted my config.php to have a base url like http://example.com/index.php . But it just does not respond. Is there something I'm missing? I've spent 2 days already on it.

这是我的config.php

here is my config.php

return 
    array(
        "base_url" => "http://example.com/index.php", 

        "providers" => array ( 
            // openid providers
            "OpenID" => array (
                "enabled" => false
            ),

            "AOL"  => array ( 
                "enabled" => false 
            ),

            "Yahoo" => array ( 
                "enabled" => false,
                "keys"    => array ( "id" => "", "secret" => "" )
            ),

            "Google" => array ( 
                "enabled" => true,
                "keys"    => array ( "id" => "", "secret" => "" )
            ),

            "Facebook" => array ( 
                "enabled" => true,
                "keys"    => array ( "id" => "xxxxxxxxx", "secret" => "xxxxxxx" )
            ),

            "Twitter" => array ( 
                "enabled" => true,
                "keys"    => array ( "key" => "xxxxxxxx", "secret" => "xxxxxxxx" ) 
            ),

            // windows live
            "Live" => array ( 
                "enabled" => false,
                "keys"    => array ( "id" => "", "secret" => "" ) 
            ),

            "MySpace" => array ( 
                "enabled" => false,
                "keys"    => array ( "key" => "", "secret" => "" ) 
            ),

            "LinkedIn" => array ( 
                "enabled" => true,
                "keys"    => array ( "key" => "xxxxxxxx", "secret" => "xxxxxxx" ) 
            ),

            "Foursquare" => array (
                "enabled" => false,
                "keys"    => array ( "id" => "", "secret" => "" ) 
            ),
        ),

        // if you want to enable logging, set 'debug_mode' to true  then provide a writable file by the web server on "debug_file"
        "debug_mode" => false,

        "debug_file" => ""
    );

有人可以帮我吗?在互联网上搜索了很长时间后,我感觉它根本无法很好地工作.如果是这样,有人可以指出更好的替代开源/免费社交登录库吗?

Can someone please help me? I got a feeling that it does not work very good at all after searching the internet for quite a long. If that's the case, can someone point to a better alternative opensource/free social signin library?

推荐答案

除了tintinboss自己的答案,我还发现我还需要检查hauth_done(这是测试Facebook的示例):

Further to tintinboss's own answer, I found I needed to check for hauth_done as well (this was for an example testing Facebook):

if (isset($_REQUEST['hauth_start']) || isset($_REQUEST['hauth_done']))
{
    Hybrid_Endpoint::process();
}

这终于奏效了-谢谢tintinboss的有用回答!

This finally got it working - thank you tintinboss for the useful answer!

这篇关于PHP HybridAuth社交登录根本不起作用.重定向到?hauth.start = Facebook& hauth.time的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆