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 &
- Unit Tests
- OAuth2 authorization flow
- Friendly configuration
- Documentation (my english is to bad .-.)