定制 longthanhtran/yii2-oauth2-resource-server 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

longthanhtran/yii2-oauth2-resource-server

Composer 安装命令:

composer require longthanhtran/yii2-oauth2-resource-server

包简介

OAuth 2.0 Resource Server

README 文档

README

Introduction.

The package is a wrapper with League's OAuth2 Server package to implement Resource Server function. This take bearer access_token and validates against define OAuth2 authz server before accepting the request.

Current support grant to communicate with OAuth2 authz server is client_credentials

Setup.

Parameters.

  • Prepare the pair of clientId and clientSecret inside @app/config/params.php file. Authorization Server url also has it detail.
...
  'resourceServer' => [
    'authzServerUrl' => 'your-oauth-authz-server-url',
    'publicKey'      => 'your-public-key-path'
  ],
  'clientCredentials' => [
    'clientId'     => 'your-client-id',
    'clientSecret' => 'your-client-secret',
  ]
...

OAuthRequester component

  • Inside @app/config/web.php, put component definition for OAuthRequest
...
  'oauthRequester' => [
    'class' => 'longthanhtran\oauth2\filters\OAuthRequester'
  ]
...

Usage

From your (rest) controller, attach the RequestValidator in behaviors function, e.g

public function behaviors()
{
  $behaviors = parent::behaviors();

  $behaviors['authenticator'] = [
    'class' => 'longthanhtran\oauth2\filters\RequestValidator'
  ];

  return $behaviors;
}

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固