marko / authentication
Authentication and authorization for Marko Framework
Package info
github.com/marko-php/marko-authentication
Type:marko-module
pkg:composer/marko/authentication
0.11.0
2026-10-06 15:20 UTC
Requires
- php: ^8.5
- marko/cache: 0.11.0
- marko/clock: 0.11.0
- marko/config: 0.11.0
- marko/core: 0.11.0
- marko/routing: 0.11.0
- marko/session: 0.11.0
Requires (Dev)
- marko/cache-array: 0.11.0
- marko/hashing: 0.11.0
- marko/ratelimiter: 0.11.0
- marko/testing: 0.11.0
Suggests
- marko/hashing: Hash login passwords with its configured driver (HASH_DRIVER, e.g. argon2id) instead of the built-in bcrypt hasher
- marko/ratelimiter: Keys login throttling by the real client IP behind trusted proxies, with IPv6 /64 bucketing
Provides
None
Conflicts
None
Replaces
None
README
Session and token-based authentication---guards protect routes, remember-me keeps users signed in, events track activity, middleware controls access.
Installation
composer require marko/authentication
Quick Example
use Marko\Authentication\AuthManager; use Marko\Routing\Http\Response; class LoginController { public function __construct( private AuthManager $authManager, ) {} public function login(array $credentials): Response { if ($this->authManager->attempt($credentials)) { return Response::redirect('/dashboard'); } return new Response('Invalid credentials', 401); } }
Documentation
Full usage, configuration, remember-me setup, events, and API reference: marko/authentication