Yii redirect()转换&到& - HybridAuth Google

时间:2014-02-06 09:50:08

标签: php yii oauth-2.0 hybridauth

我在我的网站上使用HybridAuth 2.1.2进行社交登录,使用Yii Framework实现。

Facebook没有问题。我在谷歌等其他登录时遇到了问题。

HybridAuth将用户重定向到以下URL:

https://accounts.google.com/o/oauth2/auth?client_id=XXXCLIENTIDXXX&redirect_uri=http%3A%2F%2Fwww.XXX.de%2Fsociallogin%3Fhauth.done%3DGoogle&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=online

如果我在HybridAuth / hybridauth-2.1.2 / Hybrid / Providers / Google.php中回复重定向网址,我会收到此网址:

https://accounts.google.com/o/oauth2/auth?client_id=XXXCLIENTXXX&redirect_uri=http%3A%2F%2Fwww.XXX.de%2Fsociallogin%3Fhauth.done%3DGoogle&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=online

Google.php:

[...]
    echo $this->api->authorizeUrl( $parameters );
    return true;
    Hybrid_Auth::redirect( $this->api->authorizeUrl( $parameters ) ); 
}

我认为问题是& -sign。任何想法如何抑制redirect()生成加密的URL?

1 个答案:

答案 0 :(得分:1)

将以下行添加到.htaccess文件中修复了问题:

php_value  arg_separator.output  &