Overview
What cbsecurity does and which part of it to reach for.
For any security system you need to know who the user is (authentication) and what they are allowed to do (authorization). cbsecurity provides both:
Authentication: validates credentials, logs users in and out, and tracks them in sessions or any custom storage.
Authorization: validates permissions, roles, both or neither.

Ways to Secure Your App
Pick the one that matches where you want the rule to live. They share the same validators, invalid actions, interceptions and logging, so you can mix them.
Config, JSON, XML, a database or a model
Central, data-driven policies. Rules can protect events and URLs, and admins can edit them at runtime.
Next to the route in config/Router
Securing routes and groups with no rules file, plus throttling, API keys, IP filtering and more.
When combined, rules run first, then annotations, then route middleware.

Validators
A validator knows how to authenticate and authorize a request. cbsecurity ships with:
The default. Authentication and permission security through IAuthService and IAuthUser.
The engine's cflogin security. Authentication and role security.
HTTP Basic challenges, with optional in-config user storage.
JSON Web Tokens for REST APIs.
Your own authentication and authorization engine.

How a Request Is Checked
The firewall asks the validator at preProcess. If the answer is no, it logs the block, announces an interception and runs a redirect, an override or a block. See How the Firewall Works.
Next Steps
New to cbsecurity? Start with Installation and Configuration.
Securing a REST API? See JWT.
Protecting forms? See Cross Site Request Forgery.
Debugging rules? Turn on the Visualizer.
Looking up an event? See Interceptions.
Last updated
Was this helpful?