githubEdit

Introduction

Welcome to the JWT Framework documentation. This is a modern, secure, and comprehensive PHP library for working with JSON Web Tokens (JWT), designed for both standalone applications and Symfony projects.

What is JWT Framework?

JWT Framework is a complete implementation of the JOSE (JSON Object Signing and Encryption) specifications, providing robust tools for creating, signing, encrypting, and validating JSON Web Tokens. It follows industry standards and security best practices to help you implement secure token-based authentication and data exchange in your applications.

Supported Standards

This framework provides full implementation of the following RFCs:

Key Features

🔐 Comprehensive Security

  • Support for all standard signature algorithms (HMAC, RSA, ECDSA, EdDSA)

  • Support for all standard encryption algorithms (AES-GCM, AES-CBC, RSA-OAEP, ECDH-ES)

  • Built-in header and claim validation

  • Protection against common JWT vulnerabilities

🛠️ Flexible Integration

  • Standalone library - Use it in any PHP project

  • Symfony Bundle - Seamless integration with Symfony applications

  • Console commands - CLI tools for key management and token inspection

🚀 Developer Friendly

  • Fluent API for building and loading tokens

  • Factory pattern for creating services

  • PSR-20 Clock support for time-based validation

  • Comprehensive error handling

📦 Production Ready

  • Extensively tested against RFC test vectors

  • Support for nested tokens (signed then encrypted)

  • Multiple serialization formats (Compact, JSON Flattened, JSON General)

  • Key set management for key rotation

Installation

For Symfony projects, the bundle is automatically registered.

Quick Start

Documentation Structure

This documentation is organized to help you get started quickly and dive deep when needed:

Requirements

  • PHP 8.2 or higher

  • OpenSSL extension

  • Recommended: GMP or BCMath for better performance

  • Recommended: Sodium extension for EdDSA and ECDH-ES algorithms

Get Help

Contributing

Contributions are welcome! Please read the contributing guidelines before submitting pull requests.

License

This project is released under the MIT licensearrow-up-right.

Last updated

Was this helpful?