PHPackages                             marvin255/jwt-symfony - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. marvin255/jwt-symfony

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

marvin255/jwt-symfony
=====================

Yet another JWT implementation for Symfony.

v3.0.2(1mo ago)087MITPHPPHP &gt;=8.3CI passing

Since May 6Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/marvin255/jwt-symfony)[ Packagist](https://packagist.org/packages/marvin255/jwt-symfony)[ RSS](/packages/marvin255-jwt-symfony/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (8)Dependencies (14)Versions (10)Used By (0)

JWT
===

[](#jwt)

[![Build Status](https://github.com/marvin255/jwt-symfony/workflows/jwt_symfony/badge.svg)](https://github.com/marvin255/jwt-symfony/actions?query=workflow%3A%22jwt_symfony%22)

Symfony bundle for the [marvin255/jwt](https://github.com/marvin255/jwt) library.

Installation
------------

[](#installation)

Install the bundle via Composer

```
composer req marvin255/jwt-symfony
```

Configuration
-------------

[](#configuration)

Set up one or more profiles in your configuration

```
# config/packages/marvin255_jwt_symfony.yaml
marvin255_jwt_symfony:
    profiles:
        basic:
            signer: RS256                                 # signer algorithm
            signer_public: 'file:///path/to/public.key'   # path to public key
            signer_private: 'file:///path/to/private.key' # path to private key
            signer_private_password: 'password'           # password for private key
            use_signature_constraint: true                # allow signature validation
            use_not_before_constraint: true               # allow not before validation
            not_before_leeway: 2                          # leeway to check nbf header
            use_expiration_constraint: true               # allow expiration validation
            expiration_leeway: 2                          # leeway to check exp header
            use_audience_constraint: true                 # allow audience validation
            audience: 'test'                              # audience to check
```

Usage
-----

[](#usage)

```
use Marvin255\Jwt\Symfony\Profile\JwtProfileManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use RuntimeException;

final class SiteController extends AbstractController
{
    public function __construct(private JwtProfileManager $jwtProfileManager)
    {
    }

    public function read(Request $request): void
    {
        // Select profile
        $jwtProfile = $this->jwtProfileManager->profile('basic');

        $tokenHeader = $request->headers->get('Authorization');

        // Decode the token from the header string
        $token = $jwtProfile->getDecoder()->decodeString($tokenHeader);

        // Validate the token
        $validationResult = $jwtProfile->getValidator()->validate($token);
        if (!$validationResult->isValid()) {
            $message = implode('. ', $validationResult->getErrors());
            throw new RuntimeException($message);
        }
    }

    public function build(): void
    {
        // Select profile
        $jwtProfile = $this->jwtProfileManager->profile('basic');

        // Build a token
        $token = $jwtProfile
            ->getBuilder()
            ->setJoseParam('test', 'test') // Any custom JOSE parameter
            ->setIss('test')               // Registered claims have their own setters
            ->setClaim('test', 'test')     // Any custom claim
            ->build();
    }
}
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance92

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~256 days

Recently: every ~295 days

Total

8

Last Release

40d ago

Major Versions

v1.1.0 → v2.0.02023-01-09

v2.0.1 → v3.0.02025-05-11

PHP version history (3 changes)v1.0.0PHP &gt;=8.0

v2.0.0PHP &gt;=8.1

v3.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c29b776ac327dcfcdfc20619a65826ad94a0cb554503386fb080299edfbe3e8?d=identicon)[marvin255](/maintainers/marvin255)

---

Top Contributors

[![marvin255](https://avatars.githubusercontent.com/u/2802915?v=4)](https://github.com/marvin255 "marvin255 (15 commits)")

---

Tags

jwtphpsymfonysymfony-bundlephpjwtsymfony

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/marvin255-jwt-symfony/health.svg)

```
[![Health](https://phpackages.com/badges/marvin255-jwt-symfony/health.svg)](https://phpackages.com/packages/marvin255-jwt-symfony)
```

###  Alternatives

[web-token/jwt-framework

JSON Object Signing and Encryption library for PHP and Symfony Bundle.

94518.9M77](/packages/web-token-jwt-framework)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[scheb/2fa-bundle

A generic interface to implement two-factor authentication in Symfony applications

6914.0M62](/packages/scheb-2fa-bundle)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)[auth0/symfony

Symfony SDK for Auth0 Authentication and Management APIs.

128738.1k](/packages/auth0-symfony)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

63397.4k6](/packages/web-auth-webauthn-symfony-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
