Skip to content

Lightweight PHP5 library for easy OpenID authentication.

License

Notifications You must be signed in to change notification settings

simPRO-Software/LightOpenID

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LightOpenID

Lightweight PHP5 library for easy OpenID authentication.

Quick start

  • Sign-on with OpenID is a 2-step process:

    1. Authentication with the provider:

      $openid = new LightOpenID('my-host.example.org');
      
      $openid->identity = 'ID supplied by user';
      
      header('Location: ' . $openid->authUrl());
    2. Verification:

      $openid = new LightOpenID('my-host.example.org');
      
      if ($openid->mode) {
        echo $openid->validate() ? 'Logged in.' : 'Failed!';
      }
  • AX and SREG extensions are supported:

    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');

    If the server supports only SREG or OpenID 1.1, these are automaticaly mapped to SREG names.

Identity selector

If you look for an user interface (identity selector) to use with LightOpenID, check out JavaScript OpenID Selector.

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).

License

LightOpenID is an Open Source Software available under the [MIT license] (http://opensource.org/licenses/mit-license.php).

About

Lightweight PHP5 library for easy OpenID authentication.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%