{"id":18785731,"url":"https://github.com/uzyn/cakephp-opauth","last_synced_at":"2025-04-05T06:05:46.412Z","repository":{"id":2659630,"uuid":"3650627","full_name":"uzyn/cakephp-opauth","owner":"uzyn","description":"Opauth plugin for CakePHP v2.x, allowing simple plug-n-play 3rd-party authentication with CakePHP","archived":false,"fork":false,"pushed_at":"2018-11-21T04:50:41.000Z","size":471,"stargazers_count":128,"open_issues_count":18,"forks_count":59,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-29T05:04:43.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bakery.cakephp.org/articles/uzyn/2012/06/25/simple_3rd-party_provider_authentication_with_opauth_plugin","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/uzyn.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}},"created_at":"2012-03-07T15:45:24.000Z","updated_at":"2023-09-19T01:29:02.000Z","dependencies_parsed_at":"2022-08-24T13:39:35.069Z","dependency_job_id":null,"html_url":"https://github.com/uzyn/cakephp-opauth","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzyn%2Fcakephp-opauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzyn%2Fcakephp-opauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzyn%2Fcakephp-opauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzyn%2Fcakephp-opauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uzyn","download_url":"https://codeload.github.com/uzyn/cakephp-opauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294538,"owners_count":20915340,"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":[],"created_at":"2024-11-07T20:49:32.315Z","updated_at":"2025-04-05T06:05:46.377Z","avatar_url":"https://github.com/uzyn.png","language":"PHP","funding_links":[],"categories":["Authentication and Authorization"],"sub_categories":[],"readme":"CakePHP plugin for Opauth\n=========================\n\nCakePHP 2.x plugin for [Opauth](https://github.com/uzyn/opauth).\n\nOpauth is a multi-provider authentication framework.\n\nRequirements\n---------\nCakePHP v2.x  \nOpauth \u003e= v0.2 _(submoduled with this package)_\n\nUsing [Composer](http://getcomposer.org/)?\n-----------\nYou can install CakePHP-Opauth plugin directly from Composer at [uzyn/cakephp-opauth](http://packagist.org/packages/uzyn/cakephp-opauth).  \nIt works for Opauth strategies too!\n\nView notes and Composer-enabled plugin code at [composer branch](https://github.com/uzyn/cakephp-opauth/tree/composer).\n\nTutorial \u0026 sample app\n----------\nCheck out [CakePHP bakery](http://bakery.cakephp.org/articles/uzyn/2012/06/25/simple_3rd-party_provider_authentication_with_opauth_plugin) for tutorial and the [sample branch](https://github.com/uzyn/cakephp-opauth/tree/sample) for a quick sample app.\n\nHow to use\n----------\n1. Install this plugin for your CakePHP app.   \n   Assuming `APP` is the directory where your CakePHP app resides, it's usually `app/` from the base of CakePHP.\n\n   ```bash\n   cd APP/Plugin\n   git clone git://github.com/uzyn/cakephp-opauth.git Opauth\n   ```\n\n2. Download Opauth library as a submodule.\n\n   ```bash\n   git submodule init\n   git submodule update\n   ```\n\n3. Add this line to the bottom of your app's `Config/bootstrap.php`:\n\n   ```php\n   \u003c?php\n   CakePlugin::load('Opauth', array('routes' =\u003e true, 'bootstrap' =\u003e true));\n   ```\n   Overwrite any Opauth configurations you want after the above line.\n\n4. Load [strategies](https://github.com/uzyn/opauth/wiki/list-of-strategies) onto `Strategy/` directory.\n\n   Append configuration for strategies at your app's `Config/bootstrap.php` as follows:\n   ```php\n   \u003c?php\n   CakePlugin::load('Opauth', array('routes' =\u003e true, 'bootstrap' =\u003e true));\n   \n   // Using Facebook strategy as an example\n   Configure::write('Opauth.Strategy.Facebook', array(\n       'app_id' =\u003e 'YOUR FACEBOOK APP ID',\n       'app_secret' =\u003e 'YOUR FACEBOOK APP SECRET'\n   ));\n   ```\n\n5. Go to `http://path_to_your_cake_app/auth/facebook` to authenticate with Facebook, and similarly for other strategies that you have loaded.\n\n6. After validation, user will be redirected to `Router::url('/opauth-complete')` with validated auth response data retrievable available at `$this-\u003edata`.\n\n   To route a controller to handle the response, at your app's `Config/routes.php`, add a connector, for example:\n\n   ```php\n   \u003c?php\n   Router::connect(\n       '/opauth-complete/*', \n       array('controller' =\u003e 'users', 'action' =\u003e 'opauth_complete')\n   );\n   ```\n\n   You can then work with the authentication data at, say `APP/Controller/UsersController.php` as follows:\n   \n   ```php\n   \u003c?php // APP/Controller/UsersController.php:\n   class UsersController extends AppController {\n       public function opauth_complete() {\n           debug($this-\u003edata);\n       }\n   }\n   ```\n\n   Note that this CakePHP Opauth plugin already does auth response validation for you with its results available as a boolean value at `$this-\u003edata['validated']`.\n\n7. _(optional)_ The submoduled Opauth core library may not be of the latest build, to update to the latest:  \n   ```bash\n   git submodule foreach git pull origin master\n   ```\n\n### Note:\nIf your CakePHP app **does not** reside at DocumentRoot (eg. `http://localhost`), but at a directory below DocumentRoot (eg. `http://localhost/your-cake-app`),  \nadd this line to your app's `APP/Config/bootstrap.php`, replacing `your-cake-app` with your actual path :\n\n```php\n\u003c?php // APP/Config/bootstrap.php\nConfigure::write('Opauth.path', '/your-cake-app/auth/');\n```\n\nIssues \u0026 questions\n-------------------\n- Discussion group: [Google Groups](https://groups.google.com/group/opauth)  \n  _This is the primary channel for support, especially for user questions._\n- Issues: [Github Issues](https://github.com/uzyn/cakephp-opauth/issues)  \n- Twitter: [@uzyn](http://twitter.com/uzyn)  \n- Email me: chua@uzyn.com  \n- IRC: **#opauth** on [Freenode](http://webchat.freenode.net/?channels=opauth\u0026uio=d4)\n\n\u003cp\u003eUsed this plugin in your CakePHP project? Let us know!\u003c/p\u003e\n\nLicense\n---------\nThe MIT License  \nCopyright © 2012-2013 U-Zyn Chua (http://uzyn.com)\n\nPackage building instructions\n--------------\nInstructions for making into a nice zipped package for download.\n\n```bash\ngit checkout master\ngit submodule update --init --recursive\n\nrm -rf `find . -type d -name .git`\n\ncd ..\nmv cakephp-opauth Opauth\n\nzip -mr Opauth-CakePHP-plugin-X.Y.Z.zip Opauth\n```\n\n\n\nConsultation\n---------\nU-Zyn Chua is the Principal Consultant at [Zynesis Consulting](http://zynesis.com), specializing in CakePHP.  \nLooking for PHP web development solutions or consultation? [Drop me a mail](mailto:chua@uzyn.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuzyn%2Fcakephp-opauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuzyn%2Fcakephp-opauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuzyn%2Fcakephp-opauth/lists"}