macfly/yii2-authclient-oauth2

This package is abandoned and no longer maintained. No replacement package was suggested.

OAuth2 client for yii2-oauth2-server

0.0.1 2017-02-28 15:46 UTC

This package is auto-updated.

Last update: 2023-04-13 03:41:20 UTC


README

Yii2 authclient for Oauth 2.0 Server Php work well with macfly/yii2-oauth2-server

Installation

Through Composer From console:

composer require macfly/yii2-authclient-oauth2

or add to "require" section to composer.json

"macfly/yii2-authclient-oauth2": "*"

##Usage

Set up your Oauth2 server, you can see (https://github.com/Marty-Macfly/yii2-oauth2-server) And add the Oauth2 client to your auth clients.

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
      ],
    ],
    // ...
 ]