PHPackages                             gesdinet/jwt-refresh-token-bundle - 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. gesdinet/jwt-refresh-token-bundle

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

gesdinet/jwt-refresh-token-bundle
=================================

Implements a refresh token system over Json Web Tokens in Symfony

v2.0.0(7mo ago)71018.0M↓14.8%178[1 PRs](https://github.com/markitosgv/JWTRefreshTokenBundle/pulls)20MITPHPPHP &gt;=8.2 || ^8.3 || ^8.4CI passing

Since Oct 1Pushed 2w ago11 watchersCompare

[ Source](https://github.com/markitosgv/JWTRefreshTokenBundle)[ Packagist](https://packagist.org/packages/gesdinet/jwt-refresh-token-bundle)[ RSS](/packages/gesdinet-jwt-refresh-token-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (47)Versions (59)Used By (20)

JWTRefreshTokenBundle
=====================

[](#jwtrefreshtokenbundle)

[![Run Tests](https://github.com/markitosgv/JWTRefreshTokenBundle/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/markitosgv/JWTRefreshTokenBundle/actions/workflows/run-tests.yml)[![PHP](https://camo.githubusercontent.com/40c9423d55f8fdbd46fd610254f8e794a6a791d27c3cadd17e20cf40892fdcfe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f67657364696e65742f6a77742d726566726573682d746f6b656e2d62756e646c652f7068703f6c6162656c3d50485026636f6c6f723d373737424234266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php.net)[![Symfony](https://camo.githubusercontent.com/e0ab15a9e188b373b54010e87e1a15bad602ea815cd074a1b8174c942adbda88/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f67657364696e65742f6a77742d726566726573682d746f6b656e2d62756e646c652f73796d666f6e7925324673656375726974792d62756e646c653f6c6162656c3d53796d666f6e7926636f6c6f723d303030303030266c6f676f3d73796d666f6e79266c6f676f436f6c6f723d7768697465)](https://symfony.com)[![Latest Stable Version](https://camo.githubusercontent.com/8a8a4538ba08b1301fbb9710f14dc3008205b75fd0aee8017ee8ec9dc90fb5a0/68747470733a2f2f706f7365722e707567782e6f72672f67657364696e65742f6a77742d726566726573682d746f6b656e2d62756e646c652f762f737461626c65)](https://packagist.org/packages/gesdinet/jwt-refresh-token-bundle)[![Total Downloads](https://camo.githubusercontent.com/77647ea99438b58295e9d9c2b1002c9ff583eeb743d8b830a71e75b36d31521a/68747470733a2f2f706f7365722e707567782e6f72672f67657364696e65742f6a77742d726566726573682d746f6b656e2d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/gesdinet/jwt-refresh-token-bundle)[![Monthly Downloads](https://camo.githubusercontent.com/d1e90f2d4d4b50778bc6d665fbe5507591be47276cb41effdabe3f31f741ab9d/68747470733a2f2f706f7365722e707567782e6f72672f67657364696e65742f6a77742d726566726573682d746f6b656e2d62756e646c652f642f6d6f6e74686c79)](https://packagist.org/packages/gesdinet/jwt-refresh-token-bundle/stats)[![Daily Downloads](https://camo.githubusercontent.com/887887c34bfef594b2e5583668f0a020e80a63277976402264ddfedcbe104b66/68747470733a2f2f706f7365722e707567782e6f72672f67657364696e65742f6a77742d726566726573682d746f6b656e2d62756e646c652f642f6461696c79)](https://packagist.org/packages/gesdinet/jwt-refresh-token-bundle/stats)[![License](https://camo.githubusercontent.com/070343bc6ca48b3a9d5cab5a8c3b98b6d178fa114db458dd286dca59884c0d73/68747470733a2f2f706f7365722e707567782e6f72672f67657364696e65742f6a77742d726566726573682d746f6b656e2d62756e646c652f6c6963656e7365)](https://packagist.org/packages/gesdinet/jwt-refresh-token-bundle)[![Coverage Status](https://camo.githubusercontent.com/57c1755a4fbb1800ad3b304cdd8bc0cd36c751a766ed00af448c1d7bcdb0f836/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d61726b69746f7367762f4a575452656672657368546f6b656e42756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/markitosgv/JWTRefreshTokenBundle?branch=master)[![PHPStan](https://camo.githubusercontent.com/d18b9a987aa81e64470a11caecf72caa66597c9ebd6b307bd1c2cb7a752b0dff/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c25323031302d627269676874677265656e2e737667)](https://phpstan.org/)[![Rector](https://camo.githubusercontent.com/a872e9910bc6bf5074012f3e0b1d093e974f4d480352d821b043ebd41bd0acd8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f526563746f722d656e61626c65642d627269676874677265656e2e737667)](https://getrector.org/)

Packagist has no badge for the downloads of a single release, but it does chart them: see the [download statistics](https://packagist.org/packages/gesdinet/jwt-refresh-token-bundle/stats) for the breakdown per version.

The purpose of this bundle is manage refresh tokens with JWT (Json Web Tokens) in an easy way. This bundles uses [LexikJWTAuthenticationBundle](https://github.com/lexik/LexikJWTAuthenticationBundle). Supports Doctrine ORM/ODM.

Prerequisites
-------------

[](#prerequisites)

This bundle requires PHP 8.2 or later and Symfony 6.4, 7.2+ or 8.0+. For support with older Symfony versions, please use the 1.x release. **Protip:** Though the bundle doesn't force you to do so, it is highly recommended to use HTTPS.

When upgrading, see [UPGRADE-3.0.md](UPGRADE-3.0.md), [UPGRADE-2.2.md](UPGRADE-2.2.md), [UPGRADE-2.1.md](UPGRADE-2.1.md) and [UPGRADE-2.0.md](UPGRADE-2.0.md) for what changed, and the [changelog](CHANGELOG.md) for the full list.

Coming from an older version, [UPGRADE-RECTOR.md](UPGRADE-RECTOR.md) walks the whole path from 1.5 one release at a time, with rule sets for the renames Rector can do and a checklist for the parts it cannot.

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

[](#installation)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

**You must also install either the Doctrine ORM or MongoDB ODM, these packages are not installed automatically with this bundle. Failing to do so may trigger errors on installation.**With Doctrine's ORM

```
composer require doctrine/orm doctrine/doctrine-bundle gesdinet/jwt-refresh-token-bundle
```

With Doctrine's MongoDB ODM

```
composer require doctrine/mongodb-odm doctrine/mongodb-odm-bundle gesdinet/jwt-refresh-token-bundle
```

Alternatively, a custom persistence layer can be used. For that purpose, you must:

- provide an implementation of `Doctrine\Persistence\ObjectManager`
- configure the bundle to [use your object manager](#use-another-object-manager)

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

#### For Symfony Flex Applications

[](#for-symfony-flex-applications)

For an application using Symfony Flex the bundle should be automatically registered, but if not you will need to add it to your `config/bundles.php` file.

```
