{"id":14987190,"url":"https://github.com/codeigniter4/shield","last_synced_at":"2025-04-11T01:43:06.777Z","repository":{"id":37860812,"uuid":"325478523","full_name":"codeigniter4/shield","owner":"codeigniter4","description":"Authentication and Authorization for CodeIgniter 4","archived":false,"fork":false,"pushed_at":"2025-03-31T03:57:26.000Z","size":10776,"stargazers_count":382,"open_issues_count":19,"forks_count":133,"subscribers_count":31,"default_branch":"develop","last_synced_at":"2025-04-03T18:53:31.108Z","etag":null,"topics":["auth","authentication","authorization","codeigniter4"],"latest_commit_sha":null,"homepage":"https://shield.codeigniter.com","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/codeigniter4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-30T06:55:29.000Z","updated_at":"2025-04-02T20:04:59.000Z","dependencies_parsed_at":"2024-01-19T04:28:09.967Z","dependency_job_id":"490760a0-3107-47cc-b1e1-570869d33df6","html_url":"https://github.com/codeigniter4/shield","commit_stats":{"total_commits":2113,"total_committers":80,"mean_commits":26.4125,"dds":0.4813061997160435,"last_synced_commit":"ee779a08c0dfcda12d488e6174fa559d17983e41"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeigniter4%2Fshield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeigniter4%2Fshield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeigniter4%2Fshield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeigniter4%2Fshield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeigniter4","download_url":"https://codeload.github.com/codeigniter4/shield/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248327666,"owners_count":21085256,"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":["auth","authentication","authorization","codeigniter4"],"created_at":"2024-09-24T14:14:13.999Z","updated_at":"2025-04-11T01:43:06.751Z","avatar_url":"https://github.com/codeigniter4.png","language":"PHP","readme":"# CodeIgniter Shield\n\n[![Unit Tests](https://github.com/codeigniter4/shield/workflows/PHPUnit/badge.svg)](https://github.com/codeigniter4/shield/actions/workflows/phpunit.yml)\n[![Static Analysis](https://github.com/codeigniter4/shield/workflows/PHPStan/badge.svg)](https://github.com/codeigniter4/shield/actions/workflows/phpstan.yml)\n[![PHP-CS-Fixer](https://github.com/codeigniter4/shield/actions/workflows/phpcsfixer.yml/badge.svg)](https://github.com/codeigniter4/shield/actions/workflows/phpcsfixer.yml)\n[![Rector](https://github.com/codeigniter4/shield/actions/workflows/rector.yml/badge.svg)](https://github.com/codeigniter4/shield/actions/workflows/rector.yml)\n[![Psalm](https://github.com/codeigniter4/shield/actions/workflows/psalm.yml/badge.svg)](https://github.com/codeigniter4/shield/actions/workflows/psalm.yml)\n[![Architecture](https://github.com/codeigniter4/shield/workflows/Deptrac/badge.svg)](https://github.com/codeigniter4/shield/actions/workflows/deptrac.yml)\n[![Coverage Status](https://coveralls.io/repos/github/codeigniter4/shield/badge.svg?branch=develop)](https://coveralls.io/github/codeigniter4/shield?branch=develop)\n\nShield is the official authentication and authorization framework for CodeIgniter 4.\nWhile it does provide a base set of tools\nthat are commonly used in websites, it is designed to be flexible and easily customizable.\n\nThe primary goals for Shield are:\n1. It must be very flexible and allow developers to extend/override almost any part of it.\n2. It must have security at its core. It is an auth lib after all.\n3. To cover many auth needs right out of the box, but be simple to add additional functionality to.\n\n## Authentication Methods\n\nShield provides two primary methods **Session-based** and **Access Token**\nauthentication out of the box.\n\nIt also provides **HMAC SHA256 Token** and **JSON Web Token** authentication.\n\n### Session-based\n\nThis is your typical email/username/password system you see everywhere. It includes a secure \"remember-me\" functionality.\nThis can be used for standard web applications, as well as for single page applications. Includes full controllers and\nbasic views for all standard functionality, like registration, login, forgot password, etc.\n\n### Access Token\n\nThese are much like the access tokens that GitHub uses, where they are unique to a single user, and a single user\ncan have more than one. This can be used for API authentication of third-party users, and even for allowing\naccess for a mobile application that you build.\n\n### HMAC SHA256 Token\n\nThis is a slightly more complicated improvement on Access Token authentication.\nThe main advantage with HMAC is the shared Secret Key\nis not passed in the request, but is instead used to create a hash signature of the request body.\n\n### JSON Web Token\n\nJWT or JSON Web Token is a compact and self-contained way of securely transmitting\ninformation between parties as a JSON object. It is commonly used for authentication\nand authorization purposes in web applications.\n\n## Important Features\n\n* Session-based authentication (traditional ID/Password with Remember-me)\n* Stateless authentication using Personal Access Tokens\n* Optional Email verification on account registration\n* Optional Email-based Two-Factor Authentication after login\n* Magic Link Login when a user forgets their password\n* Flexible Groups-based access control (think Roles, but more flexible)\n* Users can be granted additional Permissions\n\nSee the [An Official Auth Library](https://forum.codeigniter.com/showthread.php?tid=82003) for more Info.\n\n## Getting Started\n\n### Prerequisites\n\nUsage of Shield requires the following:\n\n- A [CodeIgniter 4.3.5+](https://github.com/codeigniter4/CodeIgniter4/) based project\n- [Composer](https://getcomposer.org/) for package management\n- PHP 8.1+\n\n### Installation\n\nInstallation is done through Composer.\n\n```console\ncomposer require codeigniter4/shield\n```\n\nSee the \u003ca href=\"https://codeigniter4.github.io/shield/\" target=\"_blank\"\u003edocs\u003c/a\u003e for more specific instructions on installation and usage recommendations.\n\n## Contributing\n\nShield does accept and encourage contributions from the community in any shape. It doesn't matter\nwhether you can code, write documentation, or help find bugs, all contributions are welcome.\nSee the [CONTRIBUTING.md](CONTRIBUTING.md) file for details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgements\n\nEvery open-source project depends on its contributors to be a success. The following users have\ncontributed in one manner or another in making Shield:\n\n\u003ca href=\"https://github.com/codeigniter4/shield/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=codeigniter4/shield\" alt=\"Contributors\"\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n\nThe following articles/sites have been fundamental in shaping the security and best practices used\nwithin this library, in no particular order:\n\n- [Google Cloud: 13 best practices for user account, authentication, and password management, 2021 edition](https://cloud.google.com/blog/products/identity-security/account-authentication-and-password-management-best-practices)\n- [NIST Digital Identity Guidelines](https://pages.nist.gov/800-63-3/sp800-63b.html)\n- [Implementing Secure User Authentication in PHP Applications with Long-Term Persistence (Login with \"Remember Me\" Cookies) ](https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence)\n- [Password Storage - OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeigniter4%2Fshield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeigniter4%2Fshield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeigniter4%2Fshield/lists"}