dsc6517 2013-03-18 13:33
浏览 64
已采纳

PHP HybridAuth社交登录根本不起作用。 重定向到?hauth.start = Facebook&hauth.time

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.

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.

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.

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?

  • 写回答

5条回答 默认 最新

  • douduonang3169 2013-08-29 21:07
    关注

    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();
    }
    

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料