dev-master
9999999-dev
MIT
The Requires
by oom
1.0.0
1.0.0.0
MIT
The Requires
by oom
Wallogit.com
2017 © Pedro Peláez
An oauth module for LUYA Api users., (*2)
Install the module trough composer, (*3)
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:, (*4)
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:, (*5)
'components' => [
//...
'user' => [
'identityClass' => 'oom\api\models\APIAuthUser',
'enableAutoLogin' => true,
'enableSession' => false,
'loginUrl' => null,
],
'urlManager' => [
'rules' => [
['class' => 'yii\rest\UrlRule', 'controller' => 'api/user'],
],
],
// ...
]
http://your.domain/api/sign/signup-test
http://your.domain/api/sign/token with app_key and app_secret data in order to get the access token.
, (*6)
http://your.domain/api/user/rules?token=ACCESS_TOKEN_FROM_TOKEN_REQUEST
, (*7)
MIT
MIT