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

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

ad3n/jwt-refresh-token-bundle
=============================

Implements a refresh token system over Json Web Tokens in Symfony

v1.0.0(1y ago)18MITPHPPHP &gt;=7.4

Since Jan 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ad3n/JWTRefreshTokenBundle)[ Packagist](https://packagist.org/packages/ad3n/jwt-refresh-token-bundle)[ RSS](/packages/ad3n-jwt-refresh-token-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (24)Versions (2)Used By (0)

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

[](#jwtrefreshtokenbundle)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/00bd6e94145f8135b7b413620d4f8c9a72959d7933a2232dd542c8ce6537e28b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67657364696e65742f4a575452656672657368546f6b656e42756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gesdinet/JWTRefreshTokenBundle/?branch=master)[![Run Tests](https://github.com/markitosgv/JWTRefreshTokenBundle/workflows/Run%20Tests/badge.svg?branch=master)](https://github.com/markitosgv/JWTRefreshTokenBundle/actions)[![Code Coverage](https://camo.githubusercontent.com/00a8458ddc6ffc66a1a5f3d111ef1133fdbfa1879520561225af769b85d0ddc6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67657364696e65742f4a575452656672657368546f6b656e42756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gesdinet/JWTRefreshTokenBundle/?branch=master)[![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)[![License](https://camo.githubusercontent.com/070343bc6ca48b3a9d5cab5a8c3b98b6d178fa114db458dd286dca59884c0d73/68747470733a2f2f706f7365722e707567782e6f72672f67657364696e65742f6a77742d726566726573682d746f6b656e2d62756e646c652f6c6963656e7365)](https://packagist.org/packages/gesdinet/jwt-refresh-token-bundle)[![StyleCI](https://camo.githubusercontent.com/e79902a9555960098efda7871cdfc7a7b1969ae4799912adebfc2de3d3b6a72a/68747470733a2f2f7374796c6563692e696f2f7265706f732f34323538323139392f736869656c64)](https://styleci.io/repos/42582199)

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 7.4 or later and Symfony 5.4 or later.

For support with older Symfony versions, please use the 0.12 release.

**Protip:** Though the bundle doesn't force you to do so, it is highly recommended to use HTTPS.

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.**

If using Symfony 5.4 with the deprecated Guard authenticators, you will also need to install the `symfony/security-guard` package. Note that it is only required for the legacy authentication API and is not compatible with Symfony 6.0.

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
```

Or, manually edit your project's `composer.json` file to add the required packages:

```
{
  "require": {
    "doctrine/doctrine-bundle": "^2.0",
    "doctrine/mongodb-odm": "^2.0",
    "doctrine/mongodb-odm-bundle": "^4.0",
    "doctrine/orm": "^2.7",
    "gesdinet/jwt-refresh-token-bundle": "^1.0"
  }
}
```

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)

#### Symfony Flex Application

[](#symfony-flex-application)

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.

```
