PHP code example of macfly / yii2-authclient-oauth2

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

    

macfly / yii2-authclient-oauth2 example snippets


php
'components' => [
    'authClientCollection' => [
      'class'   => \yii\authclient\Collection::className(),
      'clients' => [
        'oauth2-server-php' => [
          'class'             => 'macfly\authclient\OAuth2',
          'authUrl'         => 'http://193.168.5.1:8889/oauth2/authorize',
          'tokenUrl'        => 'http://193.168.5.1:8889/oauth2/token',
          'apiBaseUrl'      => 'http://193.168.5.1:8889/oauth2',
#         'returnUrl'       => 'http://127.0.0.1:8888/user/security/auth?authclient=oauth2',
          'clientId'        => 'testclient',
          'clientSecret'    => 'testpass',
        ],
        // other clients
      ],
    ],
    // ...
 ]