yii api接口接入 yii2-oauth2-server配置 filsh\yii2\oauth2server完整demo

安装说明 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',
            ],
            'grantTy

你可能感兴趣的:(yii,php,yii,php)