PHP Classes

File: web/authorization.php

Recommend this page to a friend!
  Classes of Manuel Lemos   PHP OAuth2 Server Library   web/authorization.php   Download  
File: web/authorization.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP OAuth2 Server Library
Implements an API provider using OAuth 2 protocol
Author: By
Last change: Update of web/authorization.php
Date: 11 months ago
Size: 820 bytes
 

Contents

Class file image Download
<?php
/*
 * authorization.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_authorization_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;
        if(
$error_case->initialize()
        &&
$error_case->finalize($error_case->process()))
           
$error_case->output();
    }
?>