{"id":13684134,"url":"https://github.com/dereuromark/cakephp-tinyauth","last_synced_at":"2026-02-07T11:07:31.497Z","repository":{"id":20902550,"uuid":"24190137","full_name":"dereuromark/cakephp-tinyauth","owner":"dereuromark","description":"CakePHP TinyAuth plugin for an easy and fast user authentication and authorization. Single or multi role. DB or config file based.","archived":false,"fork":false,"pushed_at":"2026-02-07T09:23:49.000Z","size":4667,"stargazers_count":129,"open_issues_count":1,"forks_count":43,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-02-07T10:39:36.738Z","etag":null,"topics":["acl","authentication","authorization","cakephp","cakephp-plugin","multi-role","php"],"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/dereuromark.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-09-18T13:56:34.000Z","updated_at":"2026-02-07T09:09:28.000Z","dependencies_parsed_at":"2024-01-20T21:22:57.705Z","dependency_job_id":"afa1d7a1-e88c-410f-ba05-5c1d44dc9907","html_url":"https://github.com/dereuromark/cakephp-tinyauth","commit_stats":{"total_commits":1329,"total_committers":45,"mean_commits":"29.533333333333335","dds":"0.36644093303235514","last_synced_commit":"64577675e8956979c70405821a9ccf2fb23078eb"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/dereuromark/cakephp-tinyauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-tinyauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-tinyauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-tinyauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-tinyauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dereuromark","download_url":"https://codeload.github.com/dereuromark/cakephp-tinyauth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-tinyauth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29193098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["acl","authentication","authorization","cakephp","cakephp-plugin","multi-role","php"],"created_at":"2024-08-02T14:00:26.845Z","updated_at":"2026-02-07T11:07:31.484Z","avatar_url":"https://github.com/dereuromark.png","language":"PHP","readme":"# CakePHP TinyAuth Plugin\n\n[![CI](https://github.com/dereuromark/cakephp-tinyauth/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/dereuromark/cakephp-tinyauth/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Latest Stable Version](https://poser.pugx.org/dereuromark/cakephp-tinyauth/v/stable.svg)](https://packagist.org/packages/dereuromark/cakephp-tinyauth)\n[![Coverage Status](https://img.shields.io/codecov/c/github/dereuromark/cakephp-tinyauth/master.svg)](https://codecov.io/github/dereuromark/cakephp-tinyauth/branch/master)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.2-8892BF.svg)](https://php.net/)\n[![License](https://poser.pugx.org/dereuromark/cakephp-tinyauth/license.svg)](LICENSE)\n[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-tinyauth/d/total.svg)](https://packagist.org/packages/dereuromark/cakephp-tinyauth)\n[![Coding Standards](https://img.shields.io/badge/cs-PSR--2--R-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards)\n\nA CakePHP plugin to handle authentication and user authorization the easy way.\n\nThis branch is for **CakePHP 5.1+**. For details see [version map](https://github.com/dereuromark/cakephp-tinyauth/wiki#cakephp-version-map).\n\n## Why use TinyAuth?\n\n**TinyAuth is a wrapper plugin** that extends CakePHP's official Authentication and Authorization plugins, providing significant advantages:\n\n### 🚀 Zero-Code Configuration\n- **INI-based setup**: Define all your authentication and authorization rules in simple INI files\n- **No controller modifications**: Unlike vanilla plugins that require code in every controller\n- **Plugin-friendly**: Automatically works with third-party plugins without modifications\n\n### ⚡ Lightning Fast Setup\n- **5-minute integration**: Get authentication and authorization working in minutes, not hours\n- **Sensible defaults**: Pre-configured settings that work for 90% of use cases\n- **Quick setups**: Built-in configurations for common scenarios (public non-prefixed, admin areas, etc.)\n\n### 🛠️ Developer Experience\n- **Centralized management**: All auth rules in one place, not scattered across controllers\n- **Easy maintenance**: Change access rules without touching code\n- **Cache optimized**: Built-in caching for maximum performance\n- **DebugKit panel**: Visualize auth status, identity, and permissions in real-time\n\n### 🔧 Flexibility\n- **Adapter pattern**: Use INI files, database, or custom adapters for rule storage\n- **Progressive enhancement**: Start simple, add complexity only when needed\n- **Stand-alone components**: Use AuthUser component/helper independently if needed\n\n### 📊 When to Choose TinyAuth\n\nChoose TinyAuth when you want:\n- ✅ Simple role-based access control (RBAC)\n- ✅ Quick setup without extensive configuration\n- ✅ Controller-action level permissions\n- ✅ Easy-to-manage access rules\n- ✅ Minimal code changes\n\nSince this plugin just further extends the official ones, you can skip the plugin's authentication and authorization components, and use the original plugins' functionality if you want:\n- ❌ Complex policy-based authorization\n- ❌ Resource-level permissions (per-entity authorization)\n- ❌ Middleware/routing level authentication\n- ❌ Custom authentication flows\n\nYou can still use the other helpers of this plugin, however.\n\n## What's the idea?\nDefault CakePHP authentication and authorization depends on code changes in at least each controller, maybe more classes.\nThis plugin hooks in with a single line of change and manages all that using config files and there is no need to touch all those controllers, including plugin controllers.\n\nIt is also possible to manage the config files without the need to code.\nAnd it can with adapters also be moved completely to the DB and managed by CRUD backend.\n\nAsk yourself: Do you need the overhead and complexity involved with a full blown (RBAC DB) ACL or very specific Policy approaches?\nSee also my post [acl-access-control-lists-revised/](https://www.dereuromark.de/2015/01/06/acl-access-control-lists-revised/).\nIf not, then this plugin could very well be your answer and a super quick solution to your auth problem :)\n\nBut even if you don't leverage the full authentication or authorization potential, the available AuthUserComponent and AuthUserHelper\ncan be very useful when dealing with role based decisions in your controller or view level. They also work stand-alone.\n\n\n## Demo\nSee https://sandbox.dereuromark.de/auth-sandbox\n\n### auth_allow.ini\nDefine the public actions (accessible by anyone) per controller:\n```ini\nUsers = index,view\nAdmin/Maintenance = pingCheck\nPluginName.SomeController = *\nMyPlugin.Api/V1 = *\n```\n\n### auth_acl.ini\nDefine what actions may be accessed by what logged-in user role:\n```ini\n[Users]\nindex = *\nadd,edit = user,super-user\n\n[Admin/Users]\n* = admin\n\n[Translate.Admin/Languages]\n* = *\n```\n\n### AuthUser component and helper\n```php\n$currentId = $this-\u003eAuthUser-\u003eid();\n\n$isMe = $this-\u003eAuthUser-\u003eisMe($userEntity-\u003eid);\n\nif ($this-\u003eAuthUser-\u003ehasRole('mod')) {\n}\n\nif ($this-\u003eAuthUser-\u003ehasAccess(['action' =\u003e 'secretArea'])) {\n}\n\n// Helper only\necho $this-\u003eAuthUser-\u003elink('Admin Backend', ['prefix' =\u003e 'Admin', 'action' =\u003e 'index']);\necho $this-\u003eAuthUser-\u003epostLink('Delete', ['action' =\u003e 'delete', $id], ['confirm' =\u003e 'Sure?']);\n```\n\n## Installation\n\n### Required Dependencies\n\n**IMPORTANT:** TinyAuth is a wrapper plugin that extends CakePHP's official plugins. You must understand them first:\n\n#### 📦 Official CakePHP Plugins\n\n| Plugin                                                                  | Purpose                                                  | Documentation                                                               |\n|-------------------------------------------------------------------------|----------------------------------------------------------|-----------------------------------------------------------------------------|\n| **[cakephp/authentication](https://github.com/cakephp/authentication)** | Handles user authentication (login, sessions, etc.)      | [📖 Official Docs](https://book.cakephp.org/authentication/3/en/index.html) |\n| **[cakephp/authorization](https://github.com/cakephp/authorization)**   | Handles user authorization (permissions, access control) | [📖 Official Docs](https://book.cakephp.org/authorization/3/en/index.html)  |\n\n```bash\n# Install for authentication features (login, sessions)\ncomposer require cakephp/authentication\n\n# Install for authorization features (roles, ACL)\ncomposer require cakephp/authorization\n```\n\n**Note:** You only need to install the plugin(s) for the features you plan to use.\nThe AuthUser component and helper can work standalone without requiring the official plugins.\n\n#### 📦 Install TinyAuth\n\nAfter installing the required official plugin(s), install TinyAuth:\n\n```bash\ncomposer require dereuromark/cakephp-tinyauth\n```\n\nFinally, load the plugin:\n\n```sh\nbin/cake plugin load TinyAuth\n```\n\n## Docs\nFor setup and usage see [Docs](/docs).\n\nAlso note the original [blog post](https://www.dereuromark.de/2011/12/18/tinyauth-the-fastest-and-easiest-authorization-for-cake2/) and how it all started.\n","funding_links":[],"categories":["Authentication and Authorization"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdereuromark%2Fcakephp-tinyauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdereuromark%2Fcakephp-tinyauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdereuromark%2Fcakephp-tinyauth/lists"}