gesdinet/jwt-refresh-token-bundle
Symfony bundle to manage JWT refresh tokens for LexikJWTAuthenticationBundle. Stores and rotates refresh tokens via Doctrine ORM or MongoDB ODM (or custom object manager), with configurable TTL, security, and endpoints. Requires PHP 8.2+ and Symfony 6.4+.
Enhanced Security for API Authentication
Compliance with Modern Auth Standards
Scalable Token Management
Multi-Tenant or B2B APIs
RefreshToken entity to include tenant IDs or custom metadata (e.g., App\Entity\JwtRefreshToken) for tenant-isolated token management.AbstractRefreshToken to add fields like scope or client_id for OAuth2 compliance.Legacy System Migration
lexik_jwt_authentication implementations with this bundle’s refresh token support, reducing tech debt.lexik_jwt_authentication (already integrated) for seamless adoption.Adopt If:
Look Elsewhere If:
tymon/jwt-auth or spatie/laravel-jwt-refresh-token.lexik_jwt_authentication alone).firebase/php-jwt or ramsey/uuid for bespoke solutions.1.x branch or a fork like dunglas/symfony-jwt-refresh-token.lexik/jwt-authentication-bundle’s blacklist option or white-october/jwt-auth-bundle)."This package lets us securely extend user sessions for our API without manual token management—critical for [compliance/X] and reducing support costs. For example, [Company Y] cut token-related incidents by 60% after adopting a similar system. It’s a low-risk, high-reward upgrade to our auth stack, with minimal dev overhead."
Key Metrics to Highlight:
lexik_jwt_authentication; no breaking changes."This bundle plugs into our existing Symfony/LexikJWT setup to add refresh tokens with zero architecture changes. It’s battle-tested (700+ stars), supports Doctrine ORM/ODM, and lets us configure TTLs, single-use tokens, or cookie storage—all via YAML. We can roll it out behind a feature flag and A/B test with mobile clients first."
Tech Benefits:
lexik_jwt_authentication out of the box.RefreshToken entity for tenant/client metadata.Migration Path:
composer.json and configure gesdinet_jwt_refresh_token.yaml.RefreshToken entity if needed (e.g., for multi-tenancy)./api/login to return refresh tokens; add /api/token/refresh endpoint.Risks:
How can I help you explore Laravel packages today?