NOTICE
I am no longer able to support or maintain this project - if you would like to take over the project, please drop me a line.
Lightweight PHP5 library for easy OpenID authentication.
Version....:
1.3.1 :arrow_double_down:
( see the change log for details )Released on:
March 04, 2016Source code:
Official GitHub Repo :octocat:Homepage...:
http://code.google.com/p/lightopenid/Author.....:
Mewp"repositories": [
{
"type": "vcs",
"url": "https://github.com/iignatov/LightOpenID"
}
],
"require": {
"php": ">=5.4.0",
"iignatov/lightopenid": "*"
}
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!';
}
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.
This library requires PHP >= 5.1.2 with cURL or HTTP/HTTPS stream wrappers enabled.
error_reporting(E_ALL | E_STRICT)
.LightOpenID is an open source software available under the MIT License.