iignatov/lightopenid
最新稳定版本:1.0.0
Composer 安装命令:
composer require iignatov/lightopenid
包简介
Lightweight PHP5 library for easy OpenID authentication.
README 文档
README
Lightweight PHP5 library for easy OpenID authentication.
Version....:1.2.0 ⏬ ( see the change log for details )Released on:January 14, 2014Source code:Gitorious 🔗 GitHub
Homepage...:http://code.google.com/p/lightopenid/Author.....:Mewp
Quick start
Sign-on with OpenID in just 2 steps:
-
Authentication with the provider:
$openid = new LightOpenID('my-host.example.org'); $openid->identity = 'ID supplied by user'; header('Location: ' . $openid->authUrl());
-
Verification:
$openid = new LightOpenID('my-host.example.org'); if ($openid->mode) { echo $openid->validate() ? 'Logged in.' : 'Failed!'; }
Support for AX and SREG extensions:
To use the AX and SREG extensions, specify $openid->required and/or $openid->optional
before calling $openid->authUrl(). These are arrays, with values being AX schema paths
(the 'path' part of the URL). For example:
$openid->required = array('namePerson/friendly', 'contact/email'); $openid->optional = array('namePerson/first');
Note that if the server supports only SREG or OpenID 1.1, these are automaticaly mapped to SREG names. To get the values use:
$openid->getAttributes();
For more information see USAGE.md.
Requirements
This library requires PHP >= 5.1.2 with cURL or HTTP/HTTPS stream wrappers enabled.
Features
- Easy to use - you can code a functional client in less than ten lines of code.
- Uses cURL if avaiable, PHP-streams otherwise.
- Supports both OpenID 1.1 and 2.0.
- Supports Yadis discovery.
- Supports only stateless/dumb protocol.
- Works with PHP >= 5.
- Generates no errors with
error_reporting(E_ALL | E_STRICT).
Links
- JavaScript OpenID Selector - simple user interface that can be used with LightOpenID.
- HybridAuth - easy to install and use social sign on PHP library, which uses LightOpenID.
- OpenID Dev Specifications - documentation for the OpenID extensions and related topics.
License
LightOpenID is an open source software available under the MIT License.
统计信息
- 总下载量: 506.2k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 1
- 依赖项目数: 9
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-01-27