{"id":19142262,"url":"https://github.com/flipboxfactory/patron","last_synced_at":"2026-03-09T04:04:34.092Z","repository":{"id":62505647,"uuid":"127385267","full_name":"flipboxfactory/patron","owner":"flipboxfactory","description":"An OAuth2 client manager for Craft CMS","archived":false,"fork":false,"pushed_at":"2025-11-03T23:35:27.000Z","size":965,"stargazers_count":3,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-04T01:18:19.535Z","etag":null,"topics":[],"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/flipboxfactory.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-30T05:27:02.000Z","updated_at":"2023-02-07T23:25:37.000Z","dependencies_parsed_at":"2024-11-27T22:16:25.705Z","dependency_job_id":null,"html_url":"https://github.com/flipboxfactory/patron","commit_stats":{"total_commits":124,"total_committers":5,"mean_commits":24.8,"dds":"0.056451612903225756","last_synced_commit":"540678fac370f80eda265482440e1bb406bd7316"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/flipboxfactory/patron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipboxfactory%2Fpatron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipboxfactory%2Fpatron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipboxfactory%2Fpatron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipboxfactory%2Fpatron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flipboxfactory","download_url":"https://codeload.github.com/flipboxfactory/patron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipboxfactory%2Fpatron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30282569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"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":[],"created_at":"2024-11-09T07:26:34.466Z","updated_at":"2026-03-09T04:04:31.623Z","avatar_url":"https://github.com/flipboxfactory.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# An OAuth2 client manager for Craft CMS\n[![Join the chat at https://gitter.im/flipboxfactory/patron](https://badges.gitter.im/flipboxfactory/patron.svg)](https://gitter.im/flipboxfactory/patron?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Latest Version](https://img.shields.io/github/release/flipboxfactory/patron.svg?style=flat-square)](https://github.com/flipboxfactory/patron/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/flipboxfactory/patron/master.svg?style=flat-square)](https://travis-ci.org/flipboxfactory/patron)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/flipboxfactory/patron.svg?style=flat-square)](https://scrutinizer-ci.com/g/flipboxfactory/patron/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/flipboxfactory/patron.svg?style=flat-square)](https://scrutinizer-ci.com/g/flipboxfactory/patron)\n[![Total Downloads](https://img.shields.io/packagist/dt/flipboxfactory/patron.svg?style=flat-square)](https://packagist.org/packages/flipboxfactory/patron)\n\nPatron is an OAuth2 client manager; Providing an easy to use interface for managing OAuth2 providers and tokens.\n\n![Screenshot](resources/screenshots/providers.png)\n\n## Requirements\nThis plugin requires Craft CMS 3.0 or later.\n\n## Installation\nChoose one of the following ways to add [Patron] to your project:\n\n1. Composer:\n\n    Simply run the following command from your project root:\n\n    ```\n    composer require flipboxfactory/patron\n    ```\n\n2. Craft CMS Plugin Store:\n\n    Within your Craft CMS project admin panel, navigate to the '[Plugin Store]' and search for '[Patron]'. Installation is a button click away.\n\n\nOnce the plugin is included in your project, navigate to the Control Panel, go to Settings → Plugins and click the “Install” button for [Patron].\n\n## Features\n[Patron] provides an Craft CMS admin interface for [The PHP League's OAuth2 client package](https://oauth2-client.thephpleague.com/). Additional features include:\n* [Project Config compatible](https://docs.craftcms.com/v3/project-config.html)\n* [Provider locking](#provider-locking) (for plugin developers)\n* Ships with native providers: Facebook, GitHub, Google, LinkedIn, Instagram\n* [Register your own OAuth2 Providers](#third-party-providers)\n\n### Templating\nThe `craft.patron` template variable provides access to the entire [Patron] plugin.  However, there are two useful tags \n worth highlighting:\n\nRetrieving providers:\n```twig\n{% set providerQuery = craft.patron.providers %}\n{% set provider = providerQuery.handle('providerHandle').one() %}\n```\n\nRetrieving tokens:\n```twig\n{% set tokenQuery = craft.patron.tokens %}\n{% set token = tokenQuery.provider('providerHandle').one() %} {# a token associated to a provider #}\n```\n\n### Screenshots\n![Proviers](resources/screenshots/providers.png)\n\n![Update](resources/screenshots/update.png)\n\n![Tokens](resources/screenshots/tokens.png)\n\n![Settings](resources/screenshots/settings.png)\n\n--- \n\n\n### Settings\nThe settings (including provider configurations) can be overridden with the plugins configuration file: `config/patron.php`\n\nIt's recommended that sensitive data (such as the client secret) is accessed via environmental variables:\n```php\n[\n    'providerHandle' =\u003e [\n        'clientId' =\u003e getenv('SOME_PROVIDER_CLIENT_ID'),\n        'clientSecret' =\u003e getenv('SOME_PROVIDER_CLIENT_SECRET'),\n    ],\n    'anotherProviderHandle' =\u003e [\n            'clientId' =\u003e getenv('SOME_OTHER_PROVIDER_CLIENT_ID'),\n            'clientSecret' =\u003e getenv('SOME_OTHER_PROVIDER_CLIENT_SECRET'),\n        ]\n]\n```\n\n\n### Third Party Providers\nAdding addition providers to [Patron] is handled through the following events:\n\n1. Register a compatible [The PHP League OAuth2 provider](https://oauth2-client.thephpleague.com/providers/implementing/) using a [fully qualified class name](https://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class).  The PHP League has an [extensive list](https://oauth2-client.thephpleague.com/providers/thirdparty/) that have been contributed by the community.\n    ```php\n    \\yii\\base\\Event::on(\n        \\flipbox\\patron\\cp\\Cp::class,\n        \\flipbox\\patron\\events\\RegisterProviders::REGISTER_PROVIDERS,\n        function (\\flipbox\\patron\\events\\RegisterProviders $event) {\n            $event-\u003eproviders[] = '\\your\\fully\\qualified\\provider\\class\\name'; // Ex: \\Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce::class\n        }\n    );\n    ```\n    \n2. \\[Optional\\] Register a settings interface for the Provider.  If your provider can be configured, the settings interface will enable configuration inputs via the Craft CP.  The settings interface will be registered on the same provider class in step 1.\n    ```php\n    \\yii\\base\\Event::on(\n        '\\your\\fully\\qualified\\provider\\class\\name', // Ex: \\Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce::class\n        \\flipbox\\patron\\events\\RegisterProviderSettings::REGISTER_SETTINGS,\n        function (\\flipbox\\patron\\events\\RegisterProviderSettings $event) {\n            $event-\u003eclass = '\\your\\fully\\qualified\\settings\\class\\name';  // Ex: \\flipbox\\patron\\salesforce\\settings\\SalesforceSettings::class\n        }\n    );\n    ```\n\n3. \\[Optional\\] Register additional info for the Provider.  Throughout the Craft CP we use a provider `name` and `icon`.  Register the following in order to specify these values: \n    ```php\n    \n    \\yii\\base\\Event::on(\n        \\flipbox\\patron\\cp\\Cp::class,\n        \\flipbox\\patron\\events\\RegisterProviderInfo::REGISTER_INFO,\n        function (\\flipbox\\patron\\events\\RegisterProviderInfo $event) {\n            $event-\u003einfo['\\your\\fully\\qualified\\provider\\class\\name] = [\n                'name' =\u003e 'Your Provider', \n                'icon' =\u003e '/path/to/icon.svg' // Ex: '@vendor/flipboxfactory/patron-salesforce/icons/salesforce.svg'\n            ];\n        }\n    );\n    \n    ```\n\nAs an example, here are a few third-party provider packages to reference:\n* [Salesforce OAuth2 Provider for Patron](https://github.com/flipboxfactory/patron-salesforce)\n* [HubSpot OAuth2 Provider for Patron](https://github.com/flipboxfactory/patron-hubspot)\n\n\n### Provider Locking\nA provider can be 'locked' by a plugin.  As a result, only the plugin (that locked it) can delete the provider.  This is useful when another plugin \nis using [Patron] to manage it's OAuth2 connections, which may not be apparent.\n\n    ```php\n    \n    /** @var \\flipbox\\patron\\records\\Provider $provider */\n    /** @var \\craft\\base\\PluginInterface $yourPlugin */\n    \n\n    $provider-\u003esaveAndLock($yourPlugin);\n    \n    ```\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/flipboxfactory/patron/blob/master/CONTRIBUTING.md) for details.\n\n\n## Credits\n\n- [Flipbox Digital](https://github.com/flipbox)\n\n## License\n\nThe MIT License (MIT). Please see [License File](https://github.com/flipboxfactory/patron/blob/master/LICENSE) for more information.\n\n[Plugin Store]: https://plugins.craftcms.com/patron\n[Patron]: https://plugins.craftcms.com/patron","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflipboxfactory%2Fpatron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflipboxfactory%2Fpatron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflipboxfactory%2Fpatron/lists"}