macfly / yii2-authclient-oauth2
OAuth2 client for yii2-oauth2-server
Installs: 1 351
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- yiisoft/yii2-authclient: >=2.0.4
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
],
],
// ...
]