PHPackages                             agven/symfony-jwt-auth - 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. agven/symfony-jwt-auth

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

agven/symfony-jwt-auth
======================

JWT Authentication Bundle for Symfony REST API

0964PHP

Since Aug 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/agven/symfony-jwt-auth)[ Packagist](https://packagist.org/packages/agven/symfony-jwt-auth)[ RSS](/packages/agven-symfony-jwt-auth/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Symfony JSON Web Token Authentication
=====================================

[](#symfony-json-web-token-authentication)

Lightweight JWT Authentication Bundle. The bundle also provides Refresh and Access tokens.

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

[](#installation)

```
composer require agven/symfony-jwt-auth

```

or add [`agven/symfony-jwt-auth`](https://github.com/agven/symfony-jwt-auth)to your `composer.json` file. This bundle using the [`firebase/php-jwt`](https://github.com/firebase/php-jwt)library for decode and encode jwt token.

Configure your `security.yml` :

```
security:
    # ...
    firewalls:
        auth:
            pattern: ^/api/auth
            anonymous: true
            stateless: true
        api:
            pattern: ^/api
            stateless: true
            guard:
                authenticators:
                    - Agven\JWTAuthBundle\Security\TokenAuthenticator
    # ...
    access_control:
        - { path: ^/api/auth,  roles: IS_AUTHENTICATED_ANONYMOUSLY, methods: [POST] }
        - { path: ^/api,       roles: ROLE_ADMIN }
```

You can get the token for user with service like this:

```
// ...
use Agven\JWTAuthBundle\Core\Services\Manager\TokenInterface as TokenManagerInterface;
// ...

class AuthManager
{
    private $tokenManager;

    public function __construct(TokenManagerInterface $tokenManager)
    {
        $this->tokenManager = $tokenManager;
    }

    public function auth(string $username, string $password)
    {
        $user = $this->userRepository->findOneByUsername($username);
        if (!$user) {
            throw new EntityNotFoundException('User not found.');
        }

        // ...
        // Validate password or todo something else
        // ...

        $token = $this->tokenManager->createAccessToken($user);
    }
```

To Do
-----

[](#to-do)

- Add tests.
- Improve documentation.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/31a2720a48ebf1ce99b981238a7c31008ecaacc8860f7fa07c60a4db0fa146d9?d=identicon)[agven](/maintainers/agven)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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