oom/luya-module-apiauth
Composer 安装命令:
composer require oom/luya-module-apiauth
包简介
README 文档
README
An oauth module for LUYA Api users.
Installation
Install the module trough composer
composer require oom/luya-module-apiauth:dev-master
In order to add the modules to your project go into the modules section of your config:
return [ 'modules' => [ // ... 'api' => [ 'class' => 'oom\api\frontend\Module', 'useAppViewPath' => true, // When enabled the views will be looked up in the @app/views folder, otherwise the views shipped with the module will be used. ], 'apiadmin' => 'oom\api\admin\Module', // ... ], ];
Enable the user component with the built in ApiAuthUser class and add the REST Url rule:
'components' => [ //... 'user' => [ 'identityClass' => 'oom\api\models\APIAuthUser', 'enableAutoLogin' => true, 'enableSession' => false, 'loginUrl' => null, ], 'urlManager' => [ 'rules' => [ ['class' => 'yii\rest\UrlRule', 'controller' => 'api/user'], ], ], // ... ]
Example usage
- Insert the test user:
http://your.domain/api/sign/signup-test - Send a post request to
http://your.domain/api/sign/tokenwithapp_keyandapp_secretdata in order to get the access token.
- Test Api with the created access token
http://your.domain/api/user/rules?token=ACCESS_TOKEN_FROM_TOKEN_REQUEST
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-15

