php - HybridAuth "Tiny Social Hub"示例重定向到/hybridauth/?hauth.start=Facebook&hauth.time

标签 php facebook oauth-2.0 hybridauth

我正在尝试弄清楚 HybridAuth 的工作原理。我已按照说明将其安装在我的服务器上,添加了 Facebook、Google 等的开发人员 key ,但是当我转到“Tiny Social Hub”示例时:

www.mysite.org/inc/examples/social_hub/login.php

然后点击“使用 Facebook 登录”,我会被重定向到:

www.mysite.org/inc/hybridauth/?hauth.start=Facebook&hauth.time=1362314218

与“使用 Google 登录”类似:

www.mysite.org/inc/hybridauth/?hauth.start=Google&hauth.time=1362314279

我只看到 /inc/hybridauth/ 的直接列表,其中包括:

index.php
config.php
Hybrid/

我错过了什么?

最佳答案

我能够解决这个问题。对于任何可能遇到此问题的人,修复是基于对问题 Hybrid auth with Yii causing a redirect loop 的回答。 ,具体有以下几点:

Your base_url in configuration file "hybridauth.php" should be set to "/hauth/endpoint" i.e. it must point to the endpoint. If you have removed index.php through .htaccess then use "/index.php/hauth/endpoint".

我需要调整我的基本网址:

"base_url" => "http://mysite.org/inc/hybridauth/"

至:

"base_url" => "http://mysite.org/inc/hybridauth/index.php"

我的猜测是第一个 url 在大多数情况下都有效,因为 index.php 通常是默认目录页面。而我已将 Apache 配置为在我的服务器上使用 home.php。

关于php - HybridAuth "Tiny Social Hub"示例重定向到/hybridauth/?hauth.start=Facebook&hauth.time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15185778/

相关文章:

php - HTML 下拉列表最佳实践

php - 在提交表单之前插入和检索 id

facebook - Node.js HTTPS POST 请求 header

javascript - Chrome/Safari (webkit) 中的 Facebook Javascript SDK 登录问题 - 不安全的 Javascript 尝试

asp.net-mvc - MVC 4 OAuth 集成。接下来是什么以及如何从数据提供者那里获取任何信息?

android - Google API 对来自 GoogleAuthUtil.getToken 的一次性授权代码的授予无效

php - PDO::PARAM 用于十进制类型?

php - moodle 如何在数据库中保存用户测验响应?

reactjs - 从google oauth2 web客户端requestAccessToken函数获取c.trim错误

authentication - 通过 stormpath 进行 Apigee 身份验证。这可行吗?