Daycry Auth Documentation๏ƒ

Welcome to the complete documentation for Daycry Auth, a comprehensive authentication and authorization library for CodeIgniter 4.

Main Features๏ƒ

Authentication๏ƒ

  • Multiple Authenticators: Session, Access Token (with scope enforcement), JWT (with refresh tokens), Magic Link

  • TOTP Two-Factor Authentication with backup codes and optional โ€œTrust this deviceโ€ bypass

  • Device Session Tracking with optional concurrent-session limit

  • Password Reset + Force Password Reset + optional rotation policy + history (no reuse)

  • OAuth 2.0 / Social Login: Google, GitHub, Facebook, Microsoft Azure, custom profile fields, OAuth events

Authorization๏ƒ

  • Groups & Permissions (RBAC) with optional persistent cache

  • API token scope enforcement (token-scope: filter)

  • Flexible Filters: Auth, chain, group, permission, token-scope, password-age, rate limiting, force-reset

Security๏ƒ

  • Per-User Account Lockout (atomic) โ€” independent of IP-based blocking

  • Compromised-Password Recheck on Login (HIBP integration, opt-in)

  • Suspicious Login Detection with suspicious-login event for email alerts

  • Timing-safe OAuth state validation

Compliance & Operations๏ƒ

  • Granular audit log (auth_audit_logs) โ€” 22 canonical event types, filterable CLI

  • GDPR helpers โ€” JSON data export + account anonymization

  • Admin CLI: auth:tokens revoke, auth:sessions terminate, auth:totp reset, auth:audit, auth:gdpr export|anonymize

  • Complete Logging: CI4 Events + database login attempts + audit log

  • Highly Customizable: Extend or replace any component

Quick Start๏ƒ

composer require daycry/auth
php spark migrate --all
php spark auth:setup
// Login
$result = auth()->attempt(['email' => 'user@example.com', 'password' => 'secret']);

if ($result->isOK()) {
    return redirect()->to('/dashboard');
}

Documentation Sections๏ƒ

Quick Start Guide๏ƒ

Install and configure Daycry Auth in minutes.

Configuration๏ƒ

Every configuration option explained with examples.

Authentication๏ƒ

Session, Access Token, JWT (with refresh), Magic Link, Password Reset, and more.

OAuth 2.0 & Social Login๏ƒ

Google, GitHub, Facebook, Microsoft Azure โ€” and any OIDC provider. Profile fields, custom resolvers, OAuth events, scopes tracking.

TOTP Two-Factor Authentication๏ƒ

Time-based OTP with authenticator apps.

Device Sessions๏ƒ

Track and manage active logins across devices.

Security Filters๏ƒ

Protect routes with authentication and authorization filters.

Controllers๏ƒ

All included controllers: Login, Register, Password Reset, Force Reset, JWT, UserSecurity.

Authorization๏ƒ

Groups, permissions, permission cache, and RBAC patterns.

Logging & Monitoring๏ƒ

CI4 Events, database logs, per-user lockout, and rate limiting.

Testing๏ƒ

Unit and integration testing with authentication mocking.

Additional Resources๏ƒ