You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-19Lines changed: 41 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,25 +12,47 @@ A CakePHP plugin to handle authentication and user authorization the easy way.
12
12
13
13
This branch is for **CakePHP 5.1+**. For details see [version map](https://github.com/dereuromark/cakephp-tinyauth/wiki#cakephp-version-map).
14
14
15
-
## Features
16
-
17
-
### Authentication
18
-
What are public actions, which ones need login?
19
-
20
-
- Powerful default configs to get you started right away.
21
-
-[Quick Setup](https://github.com/dereuromark/cakephp-tinyauth/blob/master/docs/Authentication.md#quick-setups) for 5 minute integration.
22
-
23
-
### Authorization
24
-
Once you are logged in, what actions can you see with your role(s)?
25
-
26
-
- Single-role: 1 user has 1 role (users and roles table for example)
27
-
- Multi-role: 1 user can have 1...n roles (users, roles and a "roles_users" pivot table for example)
28
-
-[Quick Setup](https://github.com/dereuromark/cakephp-tinyauth/blob/master/docs/Authorization.md#quick-setups) for 5 minute integration.
29
-
30
-
### Useful helpers
31
-
- AuthUser Component and Helper for stateful and stateless "auth data" access.
32
-
- Authentication Component and Helper for `isPublic()` check on current other other actions.
33
-
- Auth DebugKit panel for detailed insights into current URL and auth status, identity content and more.
15
+
## Why use TinyAuth as a wrapper for Authentication/Authorization plugins?
16
+
17
+
TinyAuth now acts as a powerful wrapper around CakePHP's official Authentication and Authorization plugins, providing significant advantages:
18
+
19
+
### 🚀 Zero-Code Configuration
20
+
-**INI-based setup**: Define all your authentication and authorization rules in simple INI files
21
+
-**No controller modifications**: Unlike vanilla plugins that require code in every controller
22
+
-**Plugin-friendly**: Automatically works with third-party plugins without modifications
23
+
24
+
### ⚡ Lightning Fast Setup
25
+
-**5-minute integration**: Get authentication and authorization working in minutes, not hours
26
+
-**Sensible defaults**: Pre-configured settings that work for 90% of use cases
27
+
-**Quick setups**: Built-in configurations for common scenarios (public non-prefixed, admin areas, etc.)
28
+
29
+
### 🛠️ Developer Experience
30
+
-**Centralized management**: All auth rules in one place, not scattered across controllers
31
+
-**Easy maintenance**: Change access rules without touching code
32
+
-**Cache optimized**: Built-in caching for maximum performance
33
+
-**DebugKit panel**: Visualize auth status, identity, and permissions in real-time
34
+
35
+
### 🔧 Flexibility
36
+
-**Adapter pattern**: Use INI files, database, or custom adapters for rule storage
37
+
-**Progressive enhancement**: Start simple, add complexity only when needed
38
+
-**Stand-alone components**: Use AuthUser component/helper independently if needed
39
+
40
+
### 📊 When to Choose TinyAuth
41
+
42
+
Choose TinyAuth when you want:
43
+
- ✅ Simple role-based access control (RBAC)
44
+
- ✅ Quick setup without extensive configuration
45
+
- ✅ Controller-action level permissions
46
+
- ✅ Easy-to-manage access rules
47
+
- ✅ Minimal code changes
48
+
49
+
Since 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:
This can be interested when migrating slowly to TinyAuth, for example.
137
135
Once you move such a code based rule into the INI file, you can safely remove those lines of code in your controller :)
138
136
139
137
### allow() vs deny()
140
-
Since 1.11.0 you can also mix it with `deny()` calls. From how the AuthComponent works, all allow() calls need be done before calling deny().
138
+
Since 1.11.0 you can also mix it with `deny()` calls. From how the Authentication component works, all allow() calls need be done before calling deny().
141
139
As such TinyAuth injects its list now before `Controller::beforeFilter()` gets called.
142
140
143
141
Note: It is also advised to move away from these controller calls.
0 commit comments