Skip to content

Tiebob/LightOpenID

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTICE

This project is forked from github.com/iignatov/LightOpenID. Extending for Ntpc OpenID service and add some settings. It must run with openid.php together.

LightOpenID

Lightweight PHP5 library for easy OpenID authentication.

NtpcOpenID

NtpcOpenID library for easy Ntpc OpenID Authentication and Auhtorization.

Quick start

Download openid.php and NtpcOpenID.php from github repo above.

Sign-on with OpenID in just 2 steps:

  1. Authentication with the provider:

    $openid = new NtpcOpenID('my-host.example.org');
    $openid->identity = "https://openid.ntpc.edu.tw";
    header('Location: ' . $openid->authUrl());
  2. Verification:

    $openid = new NtpcOpenID('my-host.example.org');
    
    if ($openid->mode) {
      echo $openid->validate() ? 'Logged in.' : 'Failed!';
    }

Design for Ntpc OpenID:

Without setting $openid->required values, it has default values. If full values needed, use $openid->setRequired(1). For example:

$openid = new NtpcOpenID('my-host.example.org');
$openid->identity = "https://openid.ntpc.edu.tw";
header('Location: ' . $openid->authUrl());
$openid = new NtpcOpenID('my-host.example.org');
$openid->setRequired(1);
header('Location: ' . $openid->authUrl());

After verify correct. To get the values use:

$openid->getNtpcData();

Requirements

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

Features

  • Supports Ntpc OpenID
  • Works with PHP >= 5.6

Links

License

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

About

Lightweight PHP5 library for easy OpenID authentication.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%