2014-05-21 165 views
0

我想要实现Yii中2应用社会登录。Yii2 Facebook和谷歌登录

我查了follwoing repo

但是当我需要它在我的composer.json文件时,它抛出我下面的错误

Problem 1 
- Installation request for nodge/yii2-eauth dev-master -> satisfiable by nodge/yii2-eauth[dev-master]. 
- nodge/yii2-eauth dev-master requires yiisoft/yii2 [email protected] -> no matching package found. 

Potential causes: 
- A typo in the package name 
- The package is not available in a stable-enough version according to your minimum-stability setting 
    see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. 

我研究有关替代库,但没有运气。任何其他的yii2扩展,我可以使用facebook进行用户登录?

+4

查看Yii 2的AuthClient扩展:http://www.yiiframework.com/doc-2.0/ext-authclient-index.html – davey

+0

https://github.com/dektrium/yii2-user – Kshitiz

回答

0

我使用Yii 1.x和我实现使用插件YUM(Yii的用户管理)的登录系统。 我有很多的麻烦修正了bug,添加Facebook登录功能。 最后,我决定写我自己的代码,登录系统。

在我看来,最好依靠第三方插件。你不会每次都的Facebook(或Twitter等)改变他们的API更新自己的代码的麻烦。这是开源软件的好处之一。

我会强烈建议HybridAuth:http://hybridauth.sourceforge.net/

它为每一个PHP框架插件: 正确的库http://hybridauth.sourceforge.net/plugins.html

1

运行以下命令作曲家... 它的工作对我来说...

composer require --prefer-dist yiisoft/yii2-authclient "*"