irto/oauth2-proxy

There is no license information available for the latest version (dev-master) of this package.

A PHP Proxy for OAuth2 APIs to create safe Web Apps.

dev-master 2016-02-05 18:46 UTC

This package is not auto-updated.

Last update: 2022-08-06 06:00:19 UTC


README

oauth2-proxy

A PHP Proxy for OAuth2 APIs to create safe Web Apps.

This project will help create Web App over OAuth2 API, working how a proxy (or translator) using CSRF and Session for front-end and translating in OAuth2 to back-end API. Project is working over awesome ReactPHP libs and Illuminate (from Laravel) components.

Example example\server.php:

<?php

require '../vendor/autoload.php';

$proxy = Irto\OAuth2Proxy\Server::create(array(
    'api_url' => 'http://api.web.domain',
    'port' => 8080,
    'client_id' => 'e22aa202216e86c42beac80f9a6ac2da505dc',
    'client_secret' => '471d2e22aa202216e86c42beac80f9a6ac2da5',
    'grant_path' => '/auth/token',
    'revoke_path' => '/auth/revoke',
    'grant_type' => 'client_grant',

    'session' => [
        'driver' => 'file',
        'folder' => '../storage/sessions/',
        'name' => 'tests',
        'path' => '/',
        'domain' => 'web.domain',
        'lifetime' => 3600,
    ]
        
));

$proxy->run();

?>

It's easy to run

    $ php ./server.php

...or in background with nohup

    $ nohup php ./server.php &

TODO

  • Unit Tests
  • OAuth2 authorization flow
  • Friendly configuration
  • Documentation (my english is to bad .-.)