Skip to content
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/migrations

this 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>',
        ...
    ]
]

Clone this wiki locally