githubEdit

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

circle-info

The bundle supports Symfony 7.0 and Symfony 8.0.

The bundle is automatically detected and installed when using Symfony Flex:

circle-info

As the recipes are third party recipes not officially supported by Symfony, you will be asked whether to execute the recipe or not. When applied, the recipes will display a message: Web Token Framework is ready.

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

Token Operations

Advanced Features

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

Last updated

Was this helpful?