PHP Classes

PHP OAuth2 Server Library: Implements an API provider using OAuth 2 protocol

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 83 All time: 10,065 This week: 50Up
Version License PHP version Categories
oauth2server 1.0.8BSD License5Networking, PHP 5, Web services
Description 

Author

This package implements an API provider using OAuth 2 protocol.

It provides several classes that perform several tasks to implement a PHP API that processes HTTP requests that follow the OAuth 2 protocol.

Currently, it can:

- Implement the OAuth 2 dialog to provide an access token to API clients

- Can be configured to associate API URL patterns to API call handler classes

- Provides a base class that can be extended to implement new API call handler classes with less development effort

- Calls an authorization class that can implement custom authentication of API users that can be integrated with any user management system

- Provides an API maintenance mode that allows suspending the access of an API to perform maintenance activities

- Provides an API error handling class that allows developers to customize the actions that will be performed when an API error happens

- The presentation of API dialog pages can be customized using templates organized in themes

Picture of Manuel Lemos
  Performance   Level  

 

Example

<?php
/*
 * api.php
 *
 * @(#) $Id: $
 *
 */

   
define('APPLICATION_PATH', '..');

    require(
APPLICATION_PATH.'/vendor/autoload.php');

   
$options = new oauth2_server_configuration_options_class;
   
$options->application_path = APPLICATION_PATH;
   
$options->initialize();

    if(
$options->maintenance)
       
$case = new oauth2_server_maintenance_class;
    else
       
$case = new oauth2_server_api_class;
   
$case->options = $options;
    if((
$success = $case->initialize()))
       
$success = $case->finalize($case->process());
    if(
$case->exit)
        exit;
    if(
$success)
       
$case->output();
    else
    {
       
$error_case = new oauth2_server_error_class;
       
$error_case->options = $options;
       
$error_case->error = $case->error;
       
$error_case->web = false;
       
$error_case->api = true;
        if(
$error_case->initialize()
        &&
$error_case->finalize($error_case->process()))
           
$error_case->output();
    }
?>


  Files folder image Files (32)  
File Role Description
Files folder imageconfiguration (3 files, 1 directory)
Files folder imagetemplates (4 files, 1 directory)
Files folder imageusecases (11 files, 1 directory)
Files folder imagevendor (2 files)
Files folder imageweb (3 files, 1 directory)
Accessible without login Plain text file .distribution Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:83
This week:0
All time:10,065
This week:50Up