Symfony Bundle
The JWT Framework Symfony Bundle provides seamless integration of the JWT Framework into your Symfony applications. It leverages Symfony's dependency injection container to automatically configure and wire all services, making it easy to work with JSON Web Tokens in your Symfony projects.
Why Use the Symfony Bundle?
The bundle offers several advantages for Symfony developers:
🎯 Zero Configuration
Auto-discovery of algorithms and services
Automatic service registration
Sensible defaults out of the box
🔧 Configuration-Driven
YAML-based configuration for all components
Type-safe configuration validation
Environment variable support
📊 Developer Tools
Symfony Profiler integration
Debug toolbar with token inspection
Data collectors for performance monitoring
🔄 Event System
Token lifecycle events
Hook into token creation and validation
Perfect for logging and auditing
🏭 Factory Services
Pre-configured factories for common operations
Easy creation of builders, loaders, and validators
Support for multiple configurations
Installation
With Symfony Flex (Recommended)
The bundle is automatically detected and installed when using Symfony Flex:
After installation, the bundle is automatically registered and ready to use!
Without Symfony Flex
If you're not using Symfony Flex, you need to register the bundle manually:
Quick Start Example
After installation, you can configure a simple JWS service:
Then use it in your services:
Bundle Features
The bundle provides comprehensive support for all JWT Framework components. Explore the documentation based on your needs:
Core Features
Algorithm Management - Configure signature and encryption algorithms
Key and Key Set Management - Manage cryptographic keys via configuration
Header and Claim Checkers - Validate token headers and claims
Token Operations
Signed Tokens (JWS) - Create and verify signed tokens
Encrypted Tokens (JWE) - Create and decrypt encrypted tokens
Advanced Features
Configuration Helper - Programmatic configuration
Events - Token lifecycle events and listeners
Service Auto-wiring
All services created through the bundle configuration are automatically available for auto-wiring. You can inject them by type or by name:
Configuration Reference
For a complete configuration reference, run:
Next Steps
New to the bundle? Start with Algorithm Management
Need to sign tokens? Check Signed Tokens
Need to encrypt tokens? Check Encrypted Tokens
Advanced configuration? See Configuration Helper
Last updated
Was this helpful?