安装说明 yii 安装yii2-oauth2-server 插件 filsh\yii2\oauth2server_yunxixiao的博客-CSDN博客_yii2-oauth2-server
1、安装oauth2-server 参考 https://mp.csdn.net/mp_blog/creation/editor/118488744
2、在应用程序中配置:找到自己要配置的文件 如 api/config/main.php 添加如下代码
'modules' => [
'oauth2' => [
'class' => 'filsh\yii2\oauth2server\Module',
'tokenParamName' => 'accessToken',
'tokenAccessLifetime' => 3600 * 24,
'storageMap' => [
'user_credentials' => 'common\models\FrontendUser',
],
'grantTypes' => [
'user_credentials' => [
'class' => 'OAuth2\GrantType\UserCredentials',
],
'refresh_token' => [
'class' => 'OAuth2\GrantType\RefreshToken',
'always_issue_new_refresh_token' =