Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php yii中的Hybridauth不会重定向到谷歌_Php_.htaccess_Redirect_Yii_Hybridauth - Fatal编程技术网

Php yii中的Hybridauth不会重定向到谷歌

Php yii中的Hybridauth不会重定向到谷歌,php,.htaccess,redirect,yii,hybridauth,Php,.htaccess,Redirect,Yii,Hybridauth,我一直在努力与你合作 问题是,当我想使用谷歌登录时,它只是将我重定向到 我使用htaccess从路径中删除index.php,并将index.html作为默认值,因为我只是测试yii,不想显示它,但它看起来是这样的: DirectoryIndex index.html index.php RewriteEngine on # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f R

我一直在努力与你合作

问题是,当我想使用谷歌登录时,它只是将我重定向到

我使用htaccess从路径中删除index.php,并将index.html作为默认值,因为我只是测试yii,不想显示它,但它看起来是这样的:

DirectoryIndex index.html index.php
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
Hybridauth扩展在模块部分的config/main.php中配置如下:

 'hybridauth' => array(
        'baseUrl' => 'http://'. $_SERVER['SERVER_NAME'] . '/hybridauth',
        'withYiiUser' => false, // Set to true if using yii-user
        "providers" => array (
            "google" => array (
                "enabled" => true,
                "keys"    => array ( "id" => "xxxxxxxxxxxx.apps.googleusercontent.com", "secret" => "xxxxxxxxxxxxxxxxxxxxxxxx" ),
                "scope"   => ""
            )


        )
    ), 
在google控制台上,我为web应用程序创建了客户端ID,重定向URI如下:

http://mywebsite.com/hybridauth/default/callback?hauth.done=google
我发现:

配置文件hybridauth.php中的基本url应设置为 /hauth/端点,即它必须指向端点。如果你有 通过.htaccess删除index.php,然后使用 /index.php/hauth/endpoint


我已尝试将配置中的baseUrl设置为http://'$_服务器['SERVER_NAME'].'/index.php/hybridauth没有运气。有什么问题吗?

我忘了我已经将srbac模块的debug属性设置为false,这样未经授权的用户就不能访问hybridauth。必须在srbac模块中允许hybridauth,以便每个人都可以访问它

编辑: 我在srbac控制面板中找不到hybridauth模块,我刚刚将其添加到allways allowed list中,请参阅我的回复