PHPackages                             gfreeau/get-jwt-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. gfreeau/get-jwt-bundle

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

gfreeau/get-jwt-bundle
======================

This Symfony bundle provides a security listener to return a JWT

2.0.2(8y ago)86591.6k↓17.9%37[5 issues](https://github.com/gfreeau/GfreeauGetJWTBundle/issues)3MITPHPPHP &gt;=5.3.3

Since Oct 29Pushed 6y ago2 watchersCompare

[ Source](https://github.com/gfreeau/GfreeauGetJWTBundle)[ Packagist](https://packagist.org/packages/gfreeau/get-jwt-bundle)[ Docs](https://github.com/gfreeau/GfreeauGetJWTBundle)[ RSS](/packages/gfreeau-get-jwt-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (10)Used By (3)

GfreeauGetJWTBundle
===================

[](#gfreeaugetjwtbundle)

This bundle requires LexikJWTAuthenticationBundle. Please read the docs for that bundle at

It provides a replacement for the security factory "form\_login". "form\_login" is designed for use with cookies and will set cookies even when the stateless parameter is true.

The 'switch\_user' and 'logout' config options are not supported with this security factory as they rely on cookies.

Authenticating json web tokens is provided by LexikJWTAuthenticationBundle.

Json Web Tokens are perfect for use in SPA such as AngularJS or in mobile applications. Using this bundle you can easily use symfony2 for your API.

You should use SSL connections only for your API to protect the contents of your json web tokens.

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

[](#installation)

Installation with composer:

(For Symfony2, Symfony3 and Symfony4)

```
composer require gfreeau/get-jwt-bundle "^2.0"
```

Next, be sure to enable the bundle in your `app/AppKernel.php` file:

```
public function registerBundles()
{
    return array(
        // ...
        new Gfreeau\Bundle\GetJWTBundle\GfreeauGetJWTBundle(),
        // ...
    );
}
```

Usage
-----

[](#usage)

#### Example of possible `security.yml` :

[](#example-of-possible-securityyml-)

```
    firewalls:
        gettoken:
            pattern:  ^/api/getToken$
            stateless: true
            gfreeau_get_jwt:
                # this is the default config
                username_parameter: username
                password_parameter: password
                authentication_provider: security.authentication.provider.dao
                user_checker: security.user_checker
                success_handler: lexik_jwt_authentication.handler.authentication_success
                failure_handler: lexik_jwt_authentication.handler.authentication_failure

        # protected firewall, where a user will be authenticated by its jwt token
        api:
            pattern:   ^/api
            stateless: true
            # default configuration
            lexik_jwt: ~ # check token in Authorization Header, with a value prefix of e:    bearer
```

This bundle supports the AuthenticationSuccessEvent from LexikJWTAuthenticationBundle, read their documentation for more information. You can use this event to append more information to your json web token.

A route must be defined for the url you wish to use to get your token:

```
/**
 * @Route("/api/getToken")
 * @Method({"POST"})
 */
public function getTokenAction()
{
    // The security layer will intercept this request
    return new Response('', 401);
}
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 69.1% 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 ~144 days

Recently: every ~188 days

Total

9

Last Release

3069d ago

Major Versions

1.0.5 → 2.0.02017-05-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3cd1d6e23ffc4682338abb6d5834b483f93702553cafb629b5a3542bd256add?d=identicon)[gfreeau](/maintainers/gfreeau)

---

Top Contributors

[![gfreeau](https://avatars.githubusercontent.com/u/1403669?v=4)](https://github.com/gfreeau "gfreeau (38 commits)")[![Taluu](https://avatars.githubusercontent.com/u/239685?v=4)](https://github.com/Taluu "Taluu (5 commits)")[![gamringer](https://avatars.githubusercontent.com/u/4048559?v=4)](https://github.com/gamringer "gamringer (1 commits)")[![guilhermeblanco](https://avatars.githubusercontent.com/u/208883?v=4)](https://github.com/guilhermeblanco "guilhermeblanco (1 commits)")[![ifdattic](https://avatars.githubusercontent.com/u/966877?v=4)](https://github.com/ifdattic "ifdattic (1 commits)")[![litpuvn](https://avatars.githubusercontent.com/u/5431729?v=4)](https://github.com/litpuvn "litpuvn (1 commits)")[![lsv](https://avatars.githubusercontent.com/u/20708?v=4)](https://github.com/lsv "lsv (1 commits)")[![magarzon](https://avatars.githubusercontent.com/u/351039?v=4)](https://github.com/magarzon "magarzon (1 commits)")[![stloyd](https://avatars.githubusercontent.com/u/67402?v=4)](https://github.com/stloyd "stloyd (1 commits)")[![strackovski](https://avatars.githubusercontent.com/u/3004245?v=4)](https://github.com/strackovski "strackovski (1 commits)")[![teohhanhui](https://avatars.githubusercontent.com/u/548843?v=4)](https://github.com/teohhanhui "teohhanhui (1 commits)")[![digitalkaoz](https://avatars.githubusercontent.com/u/293591?v=4)](https://github.com/digitalkaoz "digitalkaoz (1 commits)")[![thomasglachant](https://avatars.githubusercontent.com/u/1681865?v=4)](https://github.com/thomasglachant "thomasglachant (1 commits)")[![EvKoh](https://avatars.githubusercontent.com/u/1309463?v=4)](https://github.com/EvKoh "EvKoh (1 commits)")

---

Tags

jwtbundleJWSAuthenticationSymfony2

### Embed Badge

![Health badge](/badges/gfreeau-get-jwt-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/gfreeau-get-jwt-bundle/health.svg)](https://phpackages.com/packages/gfreeau-get-jwt-bundle)
```

###  Alternatives

[lexik/jwt-authentication-bundle

This bundle provides JWT authentication for your Symfony REST API

2.6k58.7M210](/packages/lexik-jwt-authentication-bundle)[web-token/jwt-framework

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

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

7014.0M62](/packages/scheb-2fa-bundle)[web-token/jwt-bundle

JWT Bundle of the JWT Framework.

132.5M7](/packages/web-token-jwt-bundle)[web-token/jwt-library

JWT library

2011.2M83](/packages/web-token-jwt-library)

PHPackages © 2026

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