{"id":15022637,"url":"https://github.com/danrvp/oauth-php","last_synced_at":"2026-04-07T05:31:19.720Z","repository":{"id":48971451,"uuid":"512228841","full_name":"DanRVP/OAuth-PHP","owner":"DanRVP","description":"Library for OAuth 1 and OAuth 2 workflows.","archived":false,"fork":false,"pushed_at":"2023-04-19T14:28:21.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T14:24:40.335Z","etag":null,"topics":["autoload","composer-package","oauth","oauth1","oauth2","php","php-library","php5","php7","php8"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanRVP.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-09T16:08:03.000Z","updated_at":"2023-10-12T17:30:42.000Z","dependencies_parsed_at":"2024-09-28T19:20:46.333Z","dependency_job_id":"4215bef8-545c-4f84-aca8-1e9a16d11dcc","html_url":"https://github.com/DanRVP/OAuth-PHP","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":0.06060606060606055,"last_synced_commit":"b54d4edf01c294f087d7d53031c912117e3e1ede"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanRVP%2FOAuth-PHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanRVP%2FOAuth-PHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanRVP%2FOAuth-PHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanRVP%2FOAuth-PHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanRVP","download_url":"https://codeload.github.com/DanRVP/OAuth-PHP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318758,"owners_count":20272144,"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":["autoload","composer-package","oauth","oauth1","oauth2","php","php-library","php5","php7","php8"],"created_at":"2024-09-24T19:58:13.398Z","updated_at":"2025-12-28T07:24:29.938Z","avatar_url":"https://github.com/DanRVP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuth-PHP\nA PHP Library for OAuth 1 and OAuth 2 workflows.\n\n### Installation\n```\ncomposer require dan-rogers/oauth-php\n```\n\n### Usage\n\n####\nOAuth 1 Example\n- Use an array of options to create a config for your auth generation.\n- Construct a new `OAuth1Config` object and use the array as the argument.\n- Construct a new `OAuth1` object and use your `OAuth1Config` object as the argument.\n- Call generateAuthorization(). \n\nSo long as you have provided the correct information for the OAuth1 step you are on, it will generate a valid auth header. \n\nFor more information on OAuth 1 usage see: \n- https://oauth.net/1/\n- https://www.rfc-editor.org/rfc/rfc5849\n\n```php\n#!/usr/bin/php\n\u003c?php\n\nuse OAuth\\OAuth1\\OAuth1;\nuse OAuth\\OAuth1\\OAuth1Config;\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$config  = new OAuth1Config([\n    'oauth_callback' =\u003e 'https://my_website/my_service/auth',\n    'oauth_consumer_key' =\u003e 'CONSUMER_KEY',\n    'consumer_secret' =\u003e 'CONSUMER_SECRET',\n    'realm' =\u003e 'MY_REALM',\n    'oauth_signature_method' =\u003e OAuth1Config::HMAC_SHA256,\n]);\n\n$oauth = new OAuth1($config);\n$auth_header = $oauth-\u003egenerateAuthorization('https://third_party/token_endpoint', 'POST');\n\n// Example usage using PHP CURL\n\n$ch = curl_init();\ncurl_setopt_array($ch, [\n    CURLOPT_URL =\u003e 'https://third_party/token_endpoint',\n    CURLOPT_CUSTOMREQUEST =\u003e 'POST',\n    CURLOPT_HTTPHEADER =\u003e [\n        'Authorization: ' . $auth_header,\n        'Content-Length: 0',\n    ],\n]);\n\n$response = curl_exec($ch);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanrvp%2Foauth-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanrvp%2Foauth-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanrvp%2Foauth-php/lists"}