{"id":43287916,"url":"https://github.com/ofbeaton/oauth2-phabricator","last_synced_at":"2026-02-01T18:04:05.663Z","repository":{"id":37547282,"uuid":"74295130","full_name":"ofbeaton/oauth2-phabricator","owner":"ofbeaton","description":"Phabricator Provider for The PHP League OAuth 2.0 Client","archived":false,"fork":false,"pushed_at":"2023-04-19T21:14:35.000Z","size":74,"stargazers_count":8,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-18T14:09:35.807Z","etag":null,"topics":["oauth","oauth-provider","oauth2","phabricator","php","php-league"],"latest_commit_sha":null,"homepage":"","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/ofbeaton.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-11-20T18:47:55.000Z","updated_at":"2024-05-29T01:51:53.000Z","dependencies_parsed_at":"2023-10-20T23:15:11.496Z","dependency_job_id":null,"html_url":"https://github.com/ofbeaton/oauth2-phabricator","commit_stats":{"total_commits":25,"total_committers":4,"mean_commits":6.25,"dds":"0.16000000000000003","last_synced_commit":"6ee86c36e0db9a84d5030570746768a38aff8f1f"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ofbeaton/oauth2-phabricator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofbeaton%2Foauth2-phabricator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofbeaton%2Foauth2-phabricator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofbeaton%2Foauth2-phabricator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofbeaton%2Foauth2-phabricator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ofbeaton","download_url":"https://codeload.github.com/ofbeaton/oauth2-phabricator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofbeaton%2Foauth2-phabricator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28984850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T17:52:09.146Z","status":"ssl_error","status_checked_at":"2026-02-01T17:49:53.529Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["oauth","oauth-provider","oauth2","phabricator","php","php-league"],"created_at":"2026-02-01T18:04:05.072Z","updated_at":"2026-02-01T18:04:05.658Z","avatar_url":"https://github.com/ofbeaton.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phabricator Provider for OAuth 2.0 Client\n[![Latest Version](https://img.shields.io/github/release/ofbeaton/oauth2-phabricator.svg?style=flat-square)](https://github.com/ofbeaton/oauth2-phabricator/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/ofbeaton/oauth2-phabricator/master.svg?style=flat-square)](https://travis-ci.org/ofbeaton/oauth2-phabricator)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/ofbeaton/oauth2-phabricator.svg?style=flat-square)](https://scrutinizer-ci.com/g/ofbeaton/oauth2-phabricator/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/ofbeaton/oauth2-phabricator.svg?style=flat-square)](https://scrutinizer-ci.com/g/ofbeaton/oauth2-phabricator)\n[![Total Downloads](https://img.shields.io/packagist/dt/ofbeaton/oauth2-phabricator.svg?style=flat-square)](https://packagist.org/packages/ofbeaton/oauth2-phabricator)\n\nThis package provides [Phabricator](https://www.phacility.com/) OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).\n\n## Updates\n\nThe project is considered in a usable state and feature complete.\n\nThis project is used in corporate applications. As such, the authors are unlikely to update it on a regular basis, but instead when the corporate applications that use it run into problems. You should expect updates in the 5-10yr range. \n\nIssues and PRs will be monitored, and we will continue to work with the community to provide updates as they are contributed.\n\n## Installation\n\nTo install, use composer:\n\n```\ncomposer require ofbeaton/oauth2-phabricator\n```\n\n## Usage\n\nUsage is the same as The League's OAuth client, using `\\Ofbeaton\\OAuth2\\Client\\Provider\\Phabricator` as the provider.\n\n### With oauth2-client bundles\n\n[Symfony Bundles](http://symfony.com/) like [knpuniversity's oauth2-client-bundle](https://github.com/knpuniversity/oauth2-client-bundle) or [HWIOAuthBundle](https://github.com/hwi/HWIOAuthBundle) use the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client) under the hood. \n\nIt is vital that you pass the domain for your phabricator install. For knpuniversity's oauth2-client-bundle this means in your Symfony `config.yml` you want this instead:\n\n```yml\nknpu_oauth2_client:\n   clients:\n      phabricator_oauth:\n         type: generic\n         provider_class: Ofbeaton\\OAuth2\\Client\\Provider\\Phabricator\n         \n         provider_options:\n            domain: %phab_host%\n            \n         client_id: %phab_client_id%\n         client_secret: %phab_client_secret%\n         redirect_route: connect_phabricator_check\n         redirect_params: {}                        \n```\n\n### Authorization Code Flow\n\n```php\n$provider = new Ofbeaton\\OAuth2\\Client\\Provider\\Phabricator([\n    'domain'            =\u003e 'https://your-phabricator-install.com',\n    'clientId'          =\u003e '{phabricator-client-id}',\n    'clientSecret'      =\u003e '{phabricator-client-secret}',\n    'redirectUri'       =\u003e 'https://your-application.com/callback-url',\n]);\n\nif (!isset($_GET['code'])) {\n\n    // If we don't have an authorization code then get one\n    $authUrl = $provider-\u003egetAuthorizationUrl();\n    $_SESSION['oauth2state'] = $provider-\u003egetState();\n    header('Location: '.$authUrl);\n    exit;\n\n// Check given state against previously stored one to mitigate CSRF attack\n} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {\n\n    unset($_SESSION['oauth2state']);\n    exit('Invalid state');\n\n} else {\n\n    // Try to get an access token (using the authorization code grant)\n    $token = $provider-\u003egetAccessToken('authorization_code', [\n        'code' =\u003e $_GET['code']\n    ]);\n\n    // Optional: Now you have a token you can look up a users profile data\n    try {\n\n        // We got an access token, let's now get the user's details\n        $user = $provider-\u003egetResourceOwner($token);\n\n        // Use these details to create a new profile\n        printf('Hello %s!', $user-\u003egetRealName());\n\n    } catch (Exception $e) {\n\n        // Failed to get user details\n        exit('Oh dear...');\n    }\n\n    // Use this to interact with an API on the users behalf\n    echo $token-\u003egetToken();\n}\n```\n\n### Managing Scopes\n\nWhen creating your Phabricator authorization URL, you can specify the state and scopes your application may authorize.\n\n```php\n$options = [\n    'state' =\u003e 'OPTIONAL_CUSTOM_CONFIGURED_STATE',\n    'scope' =\u003e ['user','user:email','repo'] // array or string\n];\n\n$authorizationUrl = $provider-\u003egetAuthorizationUrl($options);\n```\nIf neither are defined, the provider will utilize internal defaults.\n\nAt the time of authoring this documentation, [no scopes are available](https://secure.phabricator.com/book/phabcontrib/article/using_oauthserver/).\n\n## Testing\n\n``` bash\n$ ./vendor/bin/phpunit\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/ofbeaton/oauth2-phabricator/blob/master/CONTRIBUTING.md) for details.\n\n\n## Credits\n\n- [Finlay Beaton](https://ofbeaton.com)\n- [Sammy Kaye Powers](https://github.com/SammyK) (through code from [oauth2-facebook](https://github.com/thephpleague/oauth2-facebook))\n- [Steven Maguire](https://github.com/stevenmaguire) (through code from [oauth2-github](https://github.com/thephpleague/oauth2-github))\n- [All Contributors](https://github.com/ofbeaton/oauth2-phabricator/contributors)\n\n\n## License\n\nThe MIT License (MIT). Please see [License File](https://github.com/ofbeaton/oauth2-phabricator/blob/master/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofbeaton%2Foauth2-phabricator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofbeaton%2Foauth2-phabricator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofbeaton%2Foauth2-phabricator/lists"}