{"id":23380684,"url":"https://github.com/softonic/guzzle-oauth2-middleware","last_synced_at":"2025-10-30T12:49:53.893Z","repository":{"id":44454139,"uuid":"100702233","full_name":"softonic/guzzle-oauth2-middleware","owner":"softonic","description":"This package provides middleware for guzzle for handling OAuth2 token negotiation and renewal on expiry transparently.","archived":false,"fork":false,"pushed_at":"2025-01-10T10:46:18.000Z","size":30,"stargazers_count":10,"open_issues_count":3,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-14T04:58:09.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softonic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-18T10:37:22.000Z","updated_at":"2025-01-10T10:44:26.000Z","dependencies_parsed_at":"2024-07-12T09:29:16.726Z","dependency_job_id":"27ed176f-af32-4073-a2d4-32f6b47d2110","html_url":"https://github.com/softonic/guzzle-oauth2-middleware","commit_stats":{"total_commits":18,"total_committers":6,"mean_commits":3.0,"dds":0.5555555555555556,"last_synced_commit":"2e4bea29c8331b6032acbf379e19c6bc5dc1be1e"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/softonic/guzzle-oauth2-middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softonic%2Fguzzle-oauth2-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softonic%2Fguzzle-oauth2-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softonic%2Fguzzle-oauth2-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softonic%2Fguzzle-oauth2-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softonic","download_url":"https://codeload.github.com/softonic/guzzle-oauth2-middleware/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softonic%2Fguzzle-oauth2-middleware/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008618,"owners_count":26084480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T20:17:58.170Z","updated_at":"2025-10-11T20:32:28.407Z","avatar_url":"https://github.com/softonic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Guzzle OAuth2 Middleware\n=====\n\n[![Latest Version](https://img.shields.io/github/release/softonic/guzzle-oauth2-middleware.svg?style=flat-square)](https://github.com/softonic/guzzle-oauth2-middleware/releases)\n[![Software License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/softonic/guzzle-oauth2-middleware/master.svg?style=flat-square)](https://travis-ci.org/softonic/guzzle-oauth2-middleware)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/softonic/guzzle-oauth2-middleware.svg?style=flat-square)](https://scrutinizer-ci.com/g/softonic/guzzle-oauth2-middleware/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/softonic/guzzle-oauth2-middleware.svg?style=flat-square)](https://scrutinizer-ci.com/g/softonic/guzzle-oauth2-middleware)\n[![Total Downloads](https://img.shields.io/packagist/dt/softonic/guzzle-oauth2-middleware.svg?style=flat-square)](https://packagist.org/packages/softonic/guzzle-oauth2-middleware)\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/softonic/guzzle-oauth2-middleware.svg?style=flat-square)](http://isitmaintained.com/project/softonic/guzzle-oauth2-middleware \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/softonic/guzzle-oauth2-middleware.svg?style=flat-square)](http://isitmaintained.com/project/softonic/guzzle-oauth2-middleware \"Percentage of issues still open\")\n\nThis package provides middleware for [guzzle](https://github.com/guzzle/guzzle/) for handling OAuth2 token negotiation and renewal on expiry transparently. It accecpts PHP League's [OAuth 2.0 Clients](https://github.com/thephpleague/oauth2-client).\n\nInstallation\n-------\n\nTo install, use composer:\n\n```\ncomposer require softonic/guzzle-oauth2-middleware\n```\n\nUsage\n-------\n\n``` php\n\u003c?php\n$options = [\n    'clientId' =\u003e 'myclient',\n    'clientSecret' =\u003e 'mysecret'\n];\n\n// Any provider extending League\\OAuth2\\Client\\Provider\\AbstractProvider will do\n$provider = new Softonic\\OAuth2\\Client\\Provider\\Softonic($options);\n\n// Send OAuth2 parameters and use token_options for any other parameters your OAuth2 provider needs\n$config = ['grant_type' =\u003e 'client_credentials', 'scope' =\u003e 'myscope', 'token_options' =\u003e ['audience' =\u003e 'test_audience']];\n\n// Any implementation of PSR-6 Cache will do\n$cache = new \\Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter();\n\n$client = \\Softonic\\OAuth2\\Guzzle\\Middleware\\ClientBuilder::build(\n    $provider,\n    $config,\n    $cache,\n    ['base_uri' =\u003e 'https://foo.bar/']\n);\n$response = $client-\u003erequest('POST', 'qux);\n\n\n```\n\n\nTesting\n-------\n\n`softonic/guzzle-oauth2-middleware` has a [PHPUnit](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).\n\nTo run the tests, run the following command from the project folder.\n\n``` bash\n$ docker-compose run test\n```\n\nTo run interactively using [PsySH](http://psysh.org/):\n``` bash\n$ docker-compose run psysh\n```\n\nLicense\n-------\n\nThe Apache 2.0 license. Please see [LICENSE](LICENSE) for more information.\n\n[PSR-2]: http://www.php-fig.org/psr/psr-2/\n[PSR-4]: http://www.php-fig.org/psr/psr-4/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftonic%2Fguzzle-oauth2-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftonic%2Fguzzle-oauth2-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftonic%2Fguzzle-oauth2-middleware/lists"}