我正在尝试在 Yii 用户管理插件上设置混合身份验证,文档在这里https://github.com/thyseus/yii-user-management/blob/master/user/docs/hybridauth.txt
按照这个步骤
Take the modules/user/vendors/index.php, rename it to 'hybridauth.php' and place it
beside your application index.php bootstrap script. This will be your hybrid auth
entry script.
为此,没有 index.php 文件,modules/user/vendors/index.php
但有一个modules/user/vendors/hybridauth/index.php
我重命名为hybridauth.php
并将其放入http://localhost/dev/
hybridauth.php 的内容中
require_once( "protected/modules/user/vendors/hybridauth/Hybrid/Auth.php" );
require_once( "protected/modules/user/vendors/hybridauth/Hybrid/Endpoint.php" );
Hybrid_Endpoint::process();
现在为此
Place the hybrid auth configuration file into your application
protected/config/hybridauth.php.
我modules/user/vendors/hybridauth/config.php
把它放进去,protected/config/
并将config.php重命名为hybridauth.php。内容看起来像这样
return
array(
"base_url" => Yii::app()->createAbsoluteUrl('/').'/hybridauth.php',
"providers" => array (
...........
"Google" => array (
"enabled" => true,
"keys" => array (
"id" => "ID",
"secret" => "SECRET",
),
),
"Facebook" => array (
"enabled" => true,
"keys" => array (
"id" => "ID",
"secret" => "SECRET",
),
"scope" => "email,user_birthday" // https://developers.facebook.com/docs/reference/login/
),
),
// 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" => "",
);
问题是当我点击登录页面上的 Facebook 图标时,它会显示我的主页。(索引.php)
这里也是它指向的链接
http://localhost/dev/index.php/hybridauth.php?hauth.start=Facebook&hauth.time=1388044835
当我从 url 中删除 index.php
http://localhost/dev/hybridauth.php?hauth.start=Facebook&hauth.time=1388044835
我得到这个错误
您无法直接访问此页面。
知道我做错了什么吗?谢谢