Lightweight PHP library for easy OpenID authentication.

1.3.4 2020-04-20 10:48 UTC

This package is auto-updated.

Last update: 2024-06-20 20:18:03 UTC



Lightweight PHP library for easy OpenID authentication.

Quick start

Add to composer.json

composer require satariall/lightopenid

Sign-on with OpenID in just 2 steps:

  1. Authentication with the provider:

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

    $openid = new LightOpenID('');
    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:


For more information see


This library requires PHP >= 7.0 with cURL or HTTP/HTTPS stream wrappers enabled.


  • 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 >= 7.
  • Generates no errors with error_reporting(E_ALL | E_STRICT).



LightOpenID is an open source software available under the MIT License.