{"id":15277443,"url":"https://github.com/tattersoftware/codeigniter4-fireauth","last_synced_at":"2025-09-11T18:51:15.279Z","repository":{"id":49149126,"uuid":"225446891","full_name":"tattersoftware/codeigniter4-fireauth","owner":"tattersoftware","description":"Myth:Auth Firebase extension for CodeIgniter 4","archived":false,"fork":false,"pushed_at":"2023-02-03T10:03:44.000Z","size":38,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-26T09:21:39.847Z","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/tattersoftware.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":"2019-12-02T18:56:13.000Z","updated_at":"2025-03-02T22:06:06.000Z","dependencies_parsed_at":"2023-02-18T05:35:14.949Z","dependency_job_id":null,"html_url":"https://github.com/tattersoftware/codeigniter4-fireauth","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-fireauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-fireauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-fireauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-fireauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tattersoftware","download_url":"https://codeload.github.com/tattersoftware/codeigniter4-fireauth/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586251,"owners_count":21128995,"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-09-30T11:06:24.903Z","updated_at":"2025-04-12T14:52:11.831Z","avatar_url":"https://github.com/tattersoftware.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tatter\\Fireauth\n\nMyth:Auth Firebase extension for CodeIgniter 4\n\n## Quick Start\n\n1. Install with Composer: `\u003e composer require tatter/fireauth`\n2. Add credentials to your environment configuration **.env**\n3. Set the Myth:Auth login view: `'login' =\u003e 'Tatter\\Fireauth\\Views\\login'`\n\n## Description\n\nThis module extends [Myth:Auth](https://github.com/lonnieezell/myth-auth) to allow logins\nfrom [Firebase Authentication](https://firebase.google.com/docs/auth) by replacing the\ndefault login view with one configured for your Firebase app.\n\n## Installation\n\nInstall easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities\nand always be up-to-date:\n* `\u003e composer require tatter/fireauth`\n\nOr, install manually by downloading the source files and adding the directory to\n`app/Config/Autoload.php`.\n\n## Configuration\n\nThe library's default behavior can be altered by extending its config file. Copy\n**examples/Fireauth.php** to **app/Config/** and follow the instructions\nin the comments. If no config file is found in **app/Config** the library will use its own.\n\n### Credentials\n\nThe login view uses your Firebase app's credentials to connect to your project. You must\nprovide the public API key in the **.env** file in the root of your project. Add this to\nthe bottom of your file:\n\n```\n#--------------------------------------------------------------------\n# FIREBASE\n#--------------------------------------------------------------------\n\n# firebase.apiKey = YOUR_API_KEY_HERE\n```\n\nBefore using the UI you must be sure the configuration parameters are loaded and the\nFirebase instance initialized. For example, your layout might include this:\n```\n\t\u003c!-- Firebase JS SDK --\u003e\n\t\u003cscript src=\"https://www.gstatic.com/firebasejs/7.6.1/firebase-app.js\"\u003e\u003c/script\u003e\n\n\t\u003c!-- Firebase SDK config --\u003e\n\t\u003cscript src=\"\u003c?= base_url('credentials/firebase.js') ?\u003e\"\u003e\u003c/script\u003e\n\n\t\u003cscript\u003e\n\t\t// Initialize Firebase\n\t\tfirebase.initializeApp(firebaseConfig);\n\t\u003c/script\u003e\n```\n\nFor more info on acquiring your config file see\n[Firebase Project Support](http://support.google.com/firebase/answer/7015592)\n\n## Usage\n\nThis library works through Myth:Auth's `LocalAuthenticator` class to display the login and\nprovide a service for checking logged in user access and permissions. Since Firebase handles\nthe actual authentication you will need to configure your project there first and then use\nthis module's config file to match the desired behavior.\n\nMyth:Auth defines a named route for \"login\" which will display the Firebase form. Once Firebase\nhas complete authentication it sends the completed user information to the callback where\nthe account is verified and the user is logged in.\n\nRead more about authentication at Myth:Auth's\n[Authentication docs](https://github.com/lonnieezell/myth-auth/blob/develop/docs/authentication.md).\n\n### Example login\n\nThis is an example of what you should expect from Firebase's `authResult` that is used by\nthe callback to process the login:\n\n```\n{\n\t\"user\":  {\n\t\t\"uid\": \"fnBQhvsaYT5k5tXbZIGMPZiyFac1\",\n\t\t\"displayName\": \"Joe User\",\n\t\t\"photoURL\": null,\n\t\t\"email\": \"joe@example.com\",\n\t\t\"emailVerified\": false,\n\t\t\"phoneNumber\": null,\n\t\t\"isAnonymous\": false,\n\t\t\"tenantId\": null,\n\t\t\"providerData\": [\n\t\t\t{\n\t\t\t\t\"uid\": \"joe@example.com\",\n\t\t\t\t\"displayName\": \"Joe User\",\n\t\t\t\t\"photoURL\": null,\n\t\t\t\t\"email\": \"joe@example.com\",\n\t\t\t\t\"phoneNumber\": null,\n\t\t\t\t\"providerId\": \"password\"\n\t\t\t}\n\t\t],\n\t\t\"apiKey\": \"SyzCz2w8CGAIUyIlzaqHAiFC5WxIJ92T62G7wck\",\n\t\t\"appName\": \"[DEFAULT]\",\n\t\t\"authDomain\": \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4ah2uYzhbo3L22ql9CQGz4GF4XRHGBijlYPS8EaF1HT8soYdyRv4SB5gW_OAzJy4fPnxsZVFur7AYFPturSPFWZAUA0CXP7rn0H4lxfI-Z90lTX9fBYpB9FFJo7zIOpppNINzCOtKB1w2K6kNsiMIwVxJCO52drS3xZkMwP-UAEReiG6iyv46J-T2j0Q0hmc9HrHzhHMM5JSdbTXPtcX81jD1mrmKdkF-AmlMIsCRrVlMfdEUBCzDTYV4EldpcDfI_g9kbakA8Em6g\",\n\t\t\t\"expirationTime\": 1575494530086\n\t\t},\n\t\t\"redirectEventId\": null,\n\t\t\"lastLoginAt\": \"1575490930053\",\n\t\t\"createdAt\": \"1575409918661\"\n\t},\n\t\"credential\": null,\n\t\"operationType\": \"signIn\",\n\t\"additionalUserInfo\":  {\n\t\t\"providerId\": \"password\",\n\t\t\"isNewUser\": false\n\t}\n}\n```\n\nYou may do additional processing of the `user` object by defining an Event\n(in **app/Config/Events.php**) that receives the `firebase_new_user` trigger:\n\n```\nEvents::on('firebase_new_user', function($user)\n{\n\tlog_message('debug', 'New FireAuth user: ' . $user-\u003eemail);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftattersoftware%2Fcodeigniter4-fireauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftattersoftware%2Fcodeigniter4-fireauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftattersoftware%2Fcodeigniter4-fireauth/lists"}