简体   繁体   English

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

[英]HybridAuth "Tiny Social Hub" example redirecting to /hybridauth/?hauth.start=Facebook&hauth.time

I'm trying to figure out how HybridAuth works.我试图弄清楚 HybridAuth 是如何工作的。 I've installed it on my server as per instructions, added my developer key for Facebook, Google etc, however when i go to the "Tiny Social Hub" example:我已经按照说明将它安装在我的服务器上,添加了我的 Facebook、Google 等开发人员密钥,但是当我转到“Tiny Social Hub”示例时:

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

and click "Sign-in with Facebook", i get redirected to:然后单击“使用 Facebook 登录”,我被重定向到:

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

Similar with "Sign-in with Google":与“使用 Google 登录”类似:

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

And i just see the directly listing of /inc/hybridauth/ which includes:我只看到/inc/hybridauth/的直接列表,其中包括:

index.php
config.php
Hybrid/

What am i missing?我错过了什么?

I was able to solve this.我能够解决这个问题。 For anyone who might run into this problem, the fix was based on a response to the question Hybrid auth with Yii causing a redirect loop , specifically the following point:对于可能遇到此问题的任何人,修复是基于对Hybrid auth with Yii 导致重定向循环问题的回应,特别是以下几点:

Your base_url in configuration file "hybridauth.php" should be set to "/hauth/endpoint" ie it must point to the endpoint.您在配置文件“hybridauth.php”中的 base_url 应设置为“/hauth/endpoint”,即它必须指向端点。 If you have removed index.php through .htaccess then use "/index.php/hauth/endpoint".如果您通过 .htaccess 删除了 index.php,则使用“/index.php/hauth/endpoint”。

I needed to adjust my base url from:我需要调整我的基本网址:

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

to:到:

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

My guess is that the first url would work in most instances because index.php is usually the default directory page.我的猜测是第一个 url 在大多数情况下都可以工作,因为 index.php 通常是默认目录页面。 Whereas I've configured Apache to use home.php on my server.而我已将 Apache 配置为在我的服务器上使用 home.php。

Assuming you're using Apache, another solution would have been for you to tell it to recognize index.php as an index file.假设您使用的是 Apache,另一种解决方案是让您告诉它将 index.php 识别为索引文件。

Add the following in the relevant /etc/(httpd|apache2)/sites.enabled/ or httpd.conf file在相关的 /etc/(httpd|apache2)/sites.enabled/ 或 httpd.conf 文件中添加以下内容

DirectoryIndex index.php目录索引 index.php

Or, assuming apache is configured to allow .htaccess files, simply create an .htaccess file and put the above line in there.或者,假设 apache 被配置为允许 .htaccess 文件,只需创建一个 .htaccess 文件并将上面的行放在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM