承接 softonic/guzzle-oauth2-middleware 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

softonic/guzzle-oauth2-middleware

最新稳定版本:2.1.2

Composer 安装命令:

composer require softonic/guzzle-oauth2-middleware

包简介

Guzzle middleware with OAuth2 integration

README 文档

README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads Average time to resolve an issue Percentage of issues still open

This package provides middleware for guzzle for handling OAuth2 token negotiation and renewal on expiry transparently. It accecpts PHP League's OAuth 2.0 Clients.

Installation

To install, use composer:

composer require softonic/guzzle-oauth2-middleware

Usage

<?php
$options = [
    'clientId' => 'myclient',
    'clientSecret' => 'mysecret'
];

// Any provider extending League\OAuth2\Client\Provider\AbstractProvider will do
$provider = new Softonic\OAuth2\Client\Provider\Softonic($options);

// Send OAuth2 parameters and use token_options for any other parameters your OAuth2 provider needs
$config = ['grant_type' => 'client_credentials', 'scope' => 'myscope', 'token_options' => ['audience' => 'test_audience']];

// Any implementation of PSR-6 Cache will do
$cache = new \Symfony\Component\Cache\Adapter\FilesystemAdapter();

$client = \Softonic\OAuth2\Guzzle\Middleware\ClientBuilder::build(
    $provider,
    $config,
    $cache,
    ['base_uri' => 'https://foo.bar/']
);
$response = $client->request('POST', 'qux);

Testing

softonic/guzzle-oauth2-middleware has a PHPUnit test suite and a coding style compliance test suite using PHP CS Fixer.

To run the tests, run the following command from the project folder.

$ docker-compose run test

To run interactively using PsySH:

$ docker-compose run psysh

License

The Apache 2.0 license. Please see LICENSE for more information.

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 6
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固