Download the PHP package zotenme/hyperf-jwt-auth without Composer
On this page you can find all versions of the php package zotenme/hyperf-jwt-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package hyperf-jwt-auth
Hyperf JWT Authentication
JWT authentication for Hyperf 3.2+ with refresh-token rotation, revocation, single-session mode and symmetric or asymmetric signing.
Features
- 🔐 Multiple Algorithm Support - HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512
- 🔄 Atomic Token Rotation - A Redis-backed refresh token can be consumed only once
- 🚫 Token Blacklisting - Revoke tokens before expiration with grace period support
- 👤 Single Session (SSO) - A new login invalidates the subject's previous tokens
- ⚡ Hyperf 3.2 Cache Integration - Uses the configured default or named cache store
- 🛡️ Type Safe - Full PHP 8.3+ type declarations with PHPStan level 8
Quick Start
Installation
Basic Usage
Configuration
Edit config/autoload/jwt.php:
Refresh rotation is enabled by default and requires a Redis-backed Hyperf cache
store because token consumption must be atomic. Set rotation_enabled to
false only if the selected store cannot provide Redis SET NX EX.
Dynamic Expiration
Use TokenOptions to override token lifetimes for one issued session without
mutating shared Hyperf configuration:
Overrides cannot exceed the configured max_ttl. The policy and absolute
session deadline are signed into the refresh token and preserved during
rotation.
Documentation
- 📖 Installation & Configuration - Complete setup guide
- 🚀 Usage Examples - Practical examples and patterns
- 🔧 API Reference - Complete API documentation
- 🛡️ Security Guide - Best practices and security considerations
- 🍪 Secure Cookie Authentication - HttpOnly cookies, refresh and CSRF protection
- 🏗️ Advanced Features - Token rotation, SSO, RSA/ECDSA algorithms
- 🔌 Middleware Integration - HTTP middleware setup
- ⚠️ Error Handling - Exception handling guide
- ⬆️ Upgrade Guide - Migrating from 1.x to 2.0
- 📝 Changelog - Release history and notable changes
Requirements
- PHP 8.3 or higher
- Hyperf 3.2 or higher
- ext-json
Upgrading
Version 2.0 is a major update. Applications upgrading from 1.x must review configuration, Redis requirements, token cutover and custom storage changes. Follow the complete upgrade guide before deployment.
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code follows PSR-12 coding standards and includes tests.
Testing
License
This package is open-sourced software licensed under the MIT license.
Support
If you discover any security vulnerabilities or have questions, please email [email protected].
All versions of hyperf-jwt-auth with dependencies
hyperf/cache Version ^3.2
lcobucci/jwt Version ^5.5
ramsey/uuid Version ^4.9