photon/oauth2-server
Composer 安装命令:
composer require photon/oauth2-server
包简介
OAuth 2 helper for photon
README 文档
README
Quick start
-
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"
- 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".
-
Define your oauth server class in the project configuration
'oauth_server' => '\foo\bar\MyOAuth2Server'
-
Enjoy !
统计信息
- 总下载量: 147
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-2.1
- 更新时间: 2016-12-06