{"id":20980600,"url":"https://github.com/php-api-clients/psr7-oauth1","last_synced_at":"2025-05-14T15:30:45.621Z","repository":{"id":38109318,"uuid":"71936484","full_name":"php-api-clients/psr7-oauth1","owner":"php-api-clients","description":":lock_with_ink_pen:","archived":false,"fork":false,"pushed_at":"2023-12-26T22:59:41.000Z","size":427,"stargazers_count":9,"open_issues_count":4,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T22:14:09.630Z","etag":null,"topics":["hacktoberfest","oauth1","php","php7","psr-7","reactphp"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-api-clients.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"WyriHaximus"}},"created_at":"2016-10-25T20:32:24.000Z","updated_at":"2024-04-10T01:26:07.000Z","dependencies_parsed_at":"2024-06-19T13:20:15.549Z","dependency_job_id":"ae01c785-27ed-4c78-b82e-1a309c7170ee","html_url":"https://github.com/php-api-clients/psr7-oauth1","commit_stats":{"total_commits":108,"total_committers":10,"mean_commits":10.8,"dds":"0.42592592592592593","last_synced_commit":"c95c785e82494cf6f25a42fcc46ddd5cae4c2b0d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Fpsr7-oauth1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Fpsr7-oauth1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Fpsr7-oauth1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-api-clients%2Fpsr7-oauth1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-api-clients","download_url":"https://codeload.github.com/php-api-clients/psr7-oauth1/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171573,"owners_count":22026464,"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","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":["hacktoberfest","oauth1","php","php7","psr-7","reactphp"],"created_at":"2024-11-19T05:29:15.221Z","updated_at":"2025-05-14T15:30:43.756Z","avatar_url":"https://github.com/php-api-clients.png","language":"PHP","funding_links":["https://github.com/sponsors/WyriHaximus"],"categories":[],"sub_categories":[],"readme":"# Client-side PSR-7 Oauth1 request signer for PHP `^8 || ^7.4`\n\n[![Continuous Integration](https://github.com/php-api-clients/psr7-oauth1/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/php-api-clients/psr7-oauth1/actions/workflows/ci.yml)\n[![Latest Stable Version](https://poser.pugx.org/api-clients/psr7-oauth1/v/stable.png)](https://packagist.org/packages/api-clients/psr7-oauth1)\n[![Total Downloads](https://poser.pugx.org/api-clients/psr7-oauth1/downloads.png)](https://packagist.org/packages/api-clients/psr7-oauth1/stats)\n[![Code Coverage](https://scrutinizer-ci.com/g/php-api-clients/psr7-oauth1/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/php-api-clients/psr7-oauth1/?branch=master)\n[![License](https://poser.pugx.org/api-clients/psr7-oauth1/license.png)](https://packagist.org/packages/api-clients/psr7-oauth1)\n\n# Installation\n\nTo install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.\n\n```bash\ncomposer require api-clients/psr7-oauth1\n```\n\nIn case you need to support `5.5+` as well in your package, we suggest you use the following command:\n\n```bash\ncomposer require api-clients/psr7-oauth1:^1.0\n```\n\nHowever, since `1.0`, `2.0`,  and `3.0` of this package are 100% compatible, we recommend you use the following command to support both:\n\n```bash\ncomposer require \"api-clients/psr7-oauth1:^2.0 || ^1.0\"\n```\n\n# Example\n\n```php\n\u003c?php\n\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Definition;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\RequestSigning\\RequestSigner;\n\n// Pass it a PSR-7 request and it returns a signed PSR7 request you can use in any PSR7 capable HTTP client.\n// By default a HMAC-SHA1 signature will be used, this can be changed, see examples below how to do that.\n$request = (new RequestSigner(\n    new Definition\\ConsumerKey('consumer_key'),\n    new Definition\\ConsumerSecret('consumer_secret')\n))-\u003ewithAccessToken(\n    new Definition\\AccessToken('token_key'),\n    new Definition\\TokenSecret('token_secret')\n)-\u003esign($request);\n```\n\n# Suppported signatures\n\nAll supported signatures are HMAC signatures.\n\n## MD5\n\nSigns request with `HMAC-MD5`. Usage:\n\n```php\n\u003c?php\n\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Definition;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\RequestSigning\\RequestSigner;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Signature\\HmacMd5Signature;\n\n$consumerSecret = new Definition\\ConsumerSecret('consumer_secret');\n$requestSigner = new RequestSigner(\n    new Definition\\ConsumerKey('consumer_key'),\n    $consumerSecret,\n    new HmacMd5Signature($consumerSecret)\n);\n```\n\n## SHA1\n\nSigns request using `HMAC-SHA1`. Usage:\n\n```php\n\u003c?php\n\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Definition;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\RequestSigning\\RequestSigner;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Signature\\HmacSha1Signature;\n\n$consumerSecret = new Definition\\ConsumerSecret('consumer_secret');\n$requestSigner = new RequestSigner(\n    new Definition\\ConsumerKey('consumer_key'),\n    $consumerSecret,\n    new HmacSha1Signature($consumerSecret)\n);\n```\n\n## SHA256\n\nSigns request using `HMAC-SHA256`. Usage:\n\n```php\n\u003c?php\n\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Definition;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\RequestSigning\\RequestSigner;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Signature\\HmacSha256Signature;\n\n$consumerSecret = new Definition\\ConsumerSecret('consumer_secret');\n$requestSigner = new RequestSigner(\n    new Definition\\ConsumerKey('consumer_key'),\n    $consumerSecret,\n    new HmacSha256Signature($consumerSecret)\n);\n```\n\n## SHA384\n\nSigns request using `HMAC-SHA384`. Usage:\n\n```php\n\u003c?php\n\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Definition;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\RequestSigning\\RequestSigner;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Signature\\HmacSha384Signature;\n\n$consumerSecret = new Definition\\ConsumerSecret('consumer_secret');\n$requestSigner = new RequestSigner(\n    new Definition\\ConsumerKey('consumer_key'),\n    $consumerSecret,\n    new HmacSha384Signature($consumerSecret)\n);\n```\n\n## SHA512\n\nSigns request using `HMAC-SHA512`. Usage:\n\n```php\n\u003c?php\n\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Definition;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\RequestSigning\\RequestSigner;\nuse ApiClients\\Tools\\Psr7\\Oauth1\\Signature\\HmacSha512Signature;\n\n$consumerSecret = new Definition\\ConsumerSecret('consumer_secret');\n$requestSigner = new RequestSigner(\n    new Definition\\ConsumerKey('consumer_key'),\n    $consumerSecret,\n    new HmacSha512Signature($consumerSecret)\n);\n```\n\n# Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2021 Cees-Jan Kiewiet \u0026 Beau Simensen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-api-clients%2Fpsr7-oauth1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-api-clients%2Fpsr7-oauth1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-api-clients%2Fpsr7-oauth1/lists"}