PHP code example of besnovatyj / yii2-cms-oauth2

1. Go to this page and download the library: Download besnovatyj/yii2-cms-oauth2 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/ */

    

besnovatyj / yii2-cms-oauth2 example snippets


   'components' => [
       'oauth2AuthServer' => [
           'class' => \Besnovatyj\Oauth2\AuthorizationServer::class,
           'privateKeyPath' => '@app/.../keys/private.key',
           'encryptionKey'  => '...', // base64_encode(random_bytes(32)); в прод — Docker Secrets
           'accessTokenTTL' => 3600,
           'refreshTokenTTL' => 2592000,
           'keyPermissionsCheck' => !YII_DEBUG,
       ],
       'oauth2ResourceServer' => [
           'class' => \Besnovatyj\Oauth2\ResourceServer::class,
           'publicKeyPath' => '@app/.../keys/public.key',
           'keyPermissionsCheck' => !YII_DEBUG,
       ],
   ],