https://github.com/photon/oauth2-server
Wrapper for bshaffer/oauth2-server-php
https://github.com/photon/oauth2-server
oauth2-server photon php
Last synced: 10 months ago
JSON representation
Wrapper for bshaffer/oauth2-server-php
- Host: GitHub
- URL: https://github.com/photon/oauth2-server
- Owner: photon
- License: lgpl-2.1
- Created: 2016-12-05T18:01:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T12:53:42.000Z (over 9 years ago)
- Last Synced: 2025-07-17T12:16:18.178Z (11 months ago)
- Topics: oauth2-server, photon, php
- Language: PHP
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
oauth2-server
=============
[](https://travis-ci.org/photon/oauth2-server)
Quick start
-----------
1) Add the module in your project
composer require "photon/oauth2-server:dev-master"
or for a specific version
composer require "photon/oauth2-server:1.0.0"
2) Create a OAuth2 server class
You need to extends the abstract class "Server".
This class perform automatics convertion for $request and $response object.
class MyOAuth2Server extends \photon\auth\oauth2\Server
{
protected function initializeServer(&$server)
{
$storage = new \OAuth2\Storage\Mongo();
$server->addStorage($storage);
$server->addGrantType(new \OAuth2\GrantType\AuthorizationCode($storage));
...
}
}
You can use this class like the original "\OAuth2\Server".
3) Define your oauth server class in the project configuration
'oauth_server' => '\foo\bar\MyOAuth2Server'
4) Enjoy !