PHP code example of wolfpack-it / yii2-oauth

1. Go to this page and download the library: Download wolfpack-it/yii2-oauth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wolfpack-it / yii2-oauth example snippets


'modules' => [
    'oauth' => [
        'class' => \WolfpackIT\oauth\Module::class,
        'userClass' => '<class of ActiveRecordUser implementing UserEntityInterface>',
        'db' => 'db', // component that should be used for the database connection
        'publicKey' => '<path to public key file te be used by CryptKey, or configuration>',
        'privateKey' => '<path to private key file te be used by CryptKey, or configuration>',
        'encryptionKey' => '<random string for encryption>',
        'tokenValidationLeeway' => null|int, // The number of seconds to use as leeway when validating access tokens
    ]
]

'migrationNamespaces' => [
    'WolfpackIT\oauth\migrations',
    'console\migrations',
]

'aliases' => [
    '@WolfpackIT/oauth' => '@vendor/wolfpack-it/yii2-oauth/src',
]

'urlManager' => [
    'rules' => [
        'oauth/<controller:[\w-]+>/<action:[\w-]+>' => 'oauth/<controller>/<action>'
    ]
]