Laravel 单点登录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14547629/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel Single Sign-On
提问by cyberhicham
Is there any OpenID implementation on Laravel? (Provider and Consumer)
Laravel上是否有任何 OpenID 实现?(提供者和消费者)
What I'm trying to do is having One CoreApp acting like an OpenID Provider, and the otherApps as OpenID Consumers so the user can choose between :
我想要做的是让一个 CoreApp 充当 OpenID 提供者,而其他应用充当 OpenID 消费者,以便用户可以选择:
- Login with the CoreApp OpenID system
- Login with other OpenID Providers (Google, Facebook, Twitter...)
- Creating an account which means the user will be redirect to the CoreApp for creating an other account and will use that account as OpenID account to login with it on his App.
- 使用CoreApp OpenID系统登录
- 使用其他 OpenID 提供商(Google、Facebook、Twitter...)登录
- 创建一个帐户,这意味着用户将被重定向到 CoreApp 以创建另一个帐户,并将使用该帐户作为 OpenID 帐户在他的应用程序上登录。
I see that oAuth (1 & 2) are meant too for this usage ? any Laravel tutorial/howto ?
我看到 oAuth (1 & 2) 也适用于这种用法?任何 Laravel 教程/方法?
Due to the beta stage of L4 (Beta1), I guess I'm good to go with L3 for production ?
由于 L4 ( Beta1)的 beta 阶段,我想我很高兴使用 L3 进行生产?
I'm fairly new to Laravel, Still in the RTFMlevel :)
我对 Laravel 还很陌生,仍处于RTFM级别:)
采纳答案by Dan Matthews
The best route to go down with this is probably to look for something that's framework agnostic, i.e. something that would work with any PHP framework, but still does all the hard work for you.
解决这个问题的最佳途径可能是寻找与框架无关的东西,即可以与任何 PHP 框架一起使用的东西,但仍然为您完成所有艰苦的工作。
Take a look at Packagistfor lots of these, including a few good multi-provider OpenID packages and OAuth packages.
看看Packagist中的很多,包括一些好的多供应商 OpenID 包和 OAuth 包。
They're all installable with composer, and you can do a lot of the setup for them in Laravel 3 (and 4's) start.php
file.
它们都可以用 composer 安装,你可以在 Laravel 3(和 4 的)start.php
文件中为它们做很多设置。
Hope this helps!
希望这可以帮助!
回答by pkat
Check out HybridAuth. It's framework agnostic and integrates may OAuth and OAuth 2.0 providers.
查看HybridAuth。它与框架无关,并集成了 OAuth 和 OAuth 2.0 提供者。
Here is a basic example on how to implement into Laravel 4: http://www.mrcasual.com/on/coding/laravel4-package-management-with-composer/
这是一个关于如何实现 Laravel 4 的基本示例:http://www.mrcasual.com/on/coding/laravel4-package-management-with-composer/