forked from filsh/yii2-oauth2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Basic installation
Joseba Juániz edited this page Sep 9, 2015
·
10 revisions
NOTE : lots of new things here, BUT ONLY FOR BASIC INSTALLATION ONLY. FOR CHANGING BEHAVIORS AND ALL THAT, THE SPECIFIC GRANTS.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist filsh/yii2-oauth2-server "*"
or add
"filsh/yii2-oauth2-server": "~2.0"
to the require section of your composer.json.
To use this extension, simply add the following code in your application configuration:
'modules' => [
'oauth2' => [
'class' => 'filsh\yii2\oauth2server\Module',
],
...
]The next step your shold run migration
yii migrate --migrationPath=@vendor/filsh/yii2-oauth2-server/migrationsthis migration create the oauth2 database scheme and insert test user credentials testclient:testpass for http://fake/
add url rule to urlManager
'urlManager' => [
'rules' => [
'POST oauth2/<action:\w+>' => 'oauth2/default/<action>',
...
]
]-
[Configuration Options] (https://github.com/Patroklo/yii2-oauth2-server/wiki/Configuration-Options)
6.1. Authorization Code
6.3. Password
6.4. Client Credentials