{"id":19012383,"url":"https://github.com/bvrignaud/ci-fb-ion-auth","last_synced_at":"2025-04-22T23:40:56.426Z","repository":{"id":87590226,"uuid":"101095879","full_name":"bvrignaud/ci-fb-ion-auth","owner":"bvrignaud","description":"Facebook library for CodeIgniter with Ion-Auth","archived":false,"fork":false,"pushed_at":"2019-03-07T21:49:17.000Z","size":20,"stargazers_count":7,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-17T16:04:09.819Z","etag":null,"topics":["codeigniter","facebook","ion-auth"],"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/bvrignaud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2017-08-22T18:39:22.000Z","updated_at":"2020-08-26T17:30:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c4b16c0-c4d3-4a22-9eed-d6b996ebfab5","html_url":"https://github.com/bvrignaud/ci-fb-ion-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvrignaud%2Fci-fb-ion-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvrignaud%2Fci-fb-ion-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvrignaud%2Fci-fb-ion-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvrignaud%2Fci-fb-ion-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bvrignaud","download_url":"https://codeload.github.com/bvrignaud/ci-fb-ion-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343638,"owners_count":21415035,"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":["codeigniter","facebook","ion-auth"],"created_at":"2024-11-08T19:17:46.701Z","updated_at":"2025-04-22T23:40:56.420Z","avatar_url":"https://github.com/bvrignaud.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ci-fb-ion-auth\nThis is a php and CodeIgniter (3.x) library to use Facebook php SDK with Ion-Auth.\n\n## Requirements\n- PHP 5.4.0 or later (5.6 or later is recommended)\n- [CodeIgniter 3](https://www.codeigniter.com/)\n- [CodeIgniter session library](https://www.codeigniter.com/userguide3/libraries/sessions.html)\n- [Ion-Auth] (http://benedmunds.com/ion_auth/)\n- [Facebook PHP SDK v5](https://developers.facebook.com/docs/php/gettingstarted/5.0.0)\n- [Composer](https://getcomposer.org/)\n\n## Installation\n\nInstall the Facebook PHP SDK with Composer with `composer install` ([Read more](https://developers.facebook.com/docs/php/gettingstarted#install-composer)) :\n\n```sh\n$ cd /path/to/codeigniter_project/\n$ composer require facebook/graph-sdk\n```\nIn your CodeIgniter `/application/config/config.php` file, set `$config['composer_autoload']` to `TRUE`. [Read more](https://www.codeigniter.com/user_guide/general/autoloader.html).\n\nCopy the files from this package to the corresponding folder in your application folder. For example, copy application/config/facebook.php to application/config/facebook.php\n\nYou can also copy the libraries and models directories into your third_party/ci-fb-ion-auth folder. For example, copy to /application/third_party/ci-fb-ion-auth/. The directory structure would be :\n\n    config/facebook.php\n    third_party/ci-fb-ion-auth/helpers/facebook_helper.php\n    third_party/ci-fb-ion-auth/libraries/Facebook.php\n    third_party/ci-fb-ion-auth/models/Facebook_model.php\nOnly the library, model and config files are required.\n\nEdit your `facebook.php` config file in `/application/config/facebook.php` with your Facebook App details.\n\nAutoload the library in `application/config/autoload.php` or load it in needed controllers with `$this-\u003eload-\u003elibrary('facebook');`.\n\nAutoload the helper in `application/config/autoload.php` or load it in needed controllers with `$this-\u003eload-\u003ehelper('facebook_helper');`.\n\n## Relational DB Setup\nRun the SQL file `sql/ci-fb-ion-auth`.\n\n## Usage\nIn the package you will find simple example usage code in the controllers and views folders.\n\n### Register with Facebook\nview:\n\n```php\n\u003ca href=\"\u003c?=getFacebookLoginUrl('welcome/fb_register_callback')?\u003e\"\u003eRegister with Facebook\u003c/a\u003e\n```\ncontroller (welcome.php):\n\n```php\npublic function fb_register_callback()\n{\n    if ($this-\u003efacebook-\u003efb_callback()) {\n        redirect('user/account');\n    } else {\n        show_error('erreur');\n    }\n}\n```\n\n### Connexion with Facebook\nview:\n\n```php\n\u003ca href=\"\u003c?=getFacebookLoginUrl('welcome/fb_login_callback')?\u003e\"\u003eConnexion with Facebook\u003c/a\u003e\n```\ncontroller (welcome_fb_ion_auth.php):\n\n```php\npublic function fb_login_callback()\n{\n    if ($this-\u003efacebook-\u003efb_callback()) {\n        echo 'Your are now logged in !\";\n    } else {\n        show_error('erreur');\n    }\n}\n```\n### Connect/Disconnect user's Facebook account\nview :\n \n```php\nif ($this-\u003eion_auth-\u003elogged_in()) {\n    if ($this-\u003eion_auth-\u003euser()-\u003erow()-\u003eidfacebook_user) {\n        echo '\u003ca href=\"'.site_url('welcome/disconnectFacebookAccount_callback').\"\n                onclick=\"return confirm(\\'Are you sure you want to disconnect your facebook account from this application ?\\')\"\u003e\n                 Disconnect my Facebook account\n            \u003c/a\u003e';\n    } else {\n        echo '\u003ca href=\"'.getFacebookLoginUrl('welcome/connectFacebookAccount_callback').'\"\u003e\n                  Connect my Facebook account\n              \u003c/a\u003e';\n    }\n}\n```\ncontroller (welcome.php):\n\n```php\npublic function disconnectFacebookAccount_callback()\n{\n    $this-\u003efacebook-\u003edisconnectFacebookAccount();\n    redirect();\n}\n\npublic function connectFacebookAccount_callback()\n{\n    $this-\u003efacebook-\u003econnectFacebookAccount();\n    redirect();\n}\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbvrignaud%2Fci-fb-ion-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbvrignaud%2Fci-fb-ion-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbvrignaud%2Fci-fb-ion-auth/lists"}