gabel/opauth
Composer 安装命令:
composer require gabel/opauth
包简介
Multi-provider authentication framework for PHP
README 文档
README
Opauth is a multi-provider authentication framework for PHP, inspired by OmniAuth for Ruby.
Opauth enables PHP applications to do user authentication with ease.
Try out Opauth for yourself at http://opauth.org
What is Opauth?
Opauth provides a standardized method for PHP applications to interface with authentication providers.
Opauth as a framework provides a set of API that allows developers to create strategies that work in a predictable manner across PHP frameworks and applications.
Opauth works well with other PHP applications & frameworks. It is currently supported on:
- vanilla (plain) PHP applications
- CakePHP (maintained by uzyn)
- CodeIgniter (maintained by destinomultimedia)
- CodeIgniter (maintained by mcatm)
- FuelPHP (maintained by andreoav)
- Laravel (maintained by FakeHeal)
- PrestaShop (maintained by Onasusweb)
- Silex (maintained by icehero)
- SilverStripe (maintained by Better Brief)
- Zend Framework 2 (maintained by lorenzoferrarajr)
- and more to come.
If your PHP framework of choice is not yet listed, you can still use Opauth like you would a normal PHP component (class).
Quick start
Guide on how to run the bundled example.
-
Set
DocumentRootof your web server toexample/. (Opauth can be instantiated in your own PHP app, but we will leave that out of this quick start guide) -
Configure Opauth.
First, make a copy of opauth config's file by copying or renaming
opauth.conf.php.defaulttoopauth.conf.php.Open up
opauth.conf.phpand make the necessary changes. -
Install some Opauth strategies. Place the strategy files in
lib/Opauth/Strategy/.For this example, we recommend that you start with Opauth-Facebook:
i. Download the strategy files and place them at
lib/Opauth/Strategy/Facebook/.ii. Follow the steps at Opauth-Facebook's README to set up your Faceobok app.
iii. Add the following at
opauth.conf.phpunderStrategyas such:
<?php 'Strategy' => array( // Define strategies here. 'Facebook' => array( 'app_id' => 'YOUR APP ID', 'app_secret' => 'YOUR APP SECRET' ), );
Finally, send user to http://localhost/facebook to authenticate.
Check out the wiki for more in-depth details, especially on how to use Opauth with your own PHP application.
Available strategies
A strategy is a set of instructions that interfaces with respective authentication providers and relays it back to Opauth.
Provider-specific:
| Strategy | Maintained by |
|---|---|
| fancyguy | |
| rasa | |
| arbales | |
| uzyn | |
| pocket7878 | |
| pocket7878 | |
| uzyn | |
| uzyn | |
| muhdazrain | |
| uzyn | |
| uzyn | |
| ritou | |
| uzyn | |
| 24hours | |
| dgrabla | |
| uzyn | |
| LubosRemplik | |
| dgrabla | |
| ritou | |
| Yuzuru Suzuki |
Generic strategy: OAuth
See wiki's list of strategies for an updated list of Opauth strategies or to make requests. Refer also to strategy contribution guide if you would like to contribute a strategy.
Requirements
PHP 5 (>= 5.2)
with allow_url_fopen enabled
Contribute
Opauth needs your contributions, especially the following:
-
More strategies Refer to wiki for contribution guide and inform us when your work is ready.
-
Plugins for more PHP frameworks and CMSes eg. Symfony, Laravel, WordPress, Drupal, etc.
-
Guides & tutorials On how to implement Opauth on CakePHP app, etc.
Issues & questions
- Discussion group: Google Groups Primary channel for support, especially usage questions.
- Issues: Github Issues
- Twitter: @uzyn
- Email me: chua@uzyn.com
- IRC: #opauth on Freenode
Used Opauth in your project? Let us know!
Changelog
####v0.4.4 (10 May 2013)
- Added HTTP User-Agent header. (thanks @rkaldung #41)
####v0.4.3 (10 January 2013)
- Fixed a
serverPost()bug where user-supplied options were not applied correctly. (thanks @ritou #26)
####v0.4.2 (28 August 2012)
- Fix session to check for
session_id()instead of$_SESSION(thanks @sirikkoster #20)
####v0.4.1 (22 July 2012)
- Not starting session if session is already started. (thanks @Claymm)
- Fixed incorrect error message. (thanks @Claymm)
- Removed
@forfile_get_contents. (thanks @Takehiro-Adachi)
####v0.4.0 (10 June 2012)
mapProfile()andclientGet()for OpauthStrategy class.
####v0.3.0 (30 May 2012)
- Some unit testing
- More consistent naming of Strategy's internal properties
- Smarter loading of strategy, able to make a few guesses on where the class file might be at.
####v0.2.0 (23 May 2012)
- Opauth is now Composer compatible and listed on Packagist
- Opauth now supports autoloaders
- If a strategy is not autoloaded, Opauth falls back and searches for it at
strategy_dirdefined in config.
- Class name for strategy Foo should now be FooStrategy instead of Foo.
- This is to reduce the likelihood of class name collision due to Opauth not requiring the use of namespace.
- v0.1.0-type class name, ie. Foo, still works, but is now deprecated.
####v0.1.0 (22 May 2012)
- Initial release
License
The MIT License Copyright © 2012-2013 U-Zyn Chua (http://uzyn.com)
Consultation
U-Zyn Chua is a Principal Consultant at Zynesis Consulting.
gabel/opauth 适用场景与选型建议
gabel/opauth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.58k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「OpenId」 「Authentication」 「oauth」 「twitter」 「google」 「facebook」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gabel/opauth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gabel/opauth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gabel/opauth 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
WeChat OAuth SDK
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
GraphQL authentication for your headless Craft CMS applications.
Ory-Hydra OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Library for ORCID web services
Bare-bones OpenID Connect client
统计信息
- 总下载量: 9.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-12