2017 © Pedro Peláez
 

symfony-bundle get-jwt-bundle

This Symfony2 bundle provides a security listener to return a JWT

image

gfreeau/get-jwt-bundle

This Symfony2 bundle provides a security listener to return a JWT

  • Friday, December 22, 2017
  • by gfreeau
  • Repository
  • 2 Watchers
  • 76 Stars
  • 198,086 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 27 Forks
  • 1 Open issues
  • 11 Versions
  • 8 % Grown

The README.md

GfreeauGetJWTBundle

This bundle requires LexikJWTAuthenticationBundle. Please read the docs for that bundle at https://github.com/lexik/LexikJWTAuthenticationBundle, (*1)

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., (*2)

The 'switch_user' and 'logout' config options are not supported with this security factory as they rely on cookies., (*3)

Authenticating json web tokens is provided by LexikJWTAuthenticationBundle., (*4)

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., (*5)

You should use SSL connections only for your API to protect the contents of your json web tokens., (*6)

Installation

Installation with composer:, (*7)

(For Symfony2, Symfony3 and Symfony4), (*8)

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

Next, be sure to enable the bundle in your app/AppKernel.php file:, (*9)

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


Usage ----- #### Example of possible `security.yml` : ``` yaml 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., (*11)

A route must be defined for the url you wish to use to get your token:, (*12)

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

The Versions

22/12 2017

dev-master

9999999-dev https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

22/12 2017

2.0.2

2.0.2.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

01/12 2017

2.0.1

2.0.1.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

03/05 2017

dev-dev

dev-dev https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

03/05 2017

2.0.0

2.0.0.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

03/12 2015

1.0.5

1.0.5.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

02/12 2015

1.0.4

1.0.4.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

01/12 2015

1.0.3

1.0.3.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

28/07 2015

1.0.2

1.0.2.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

03/06 2015

1.0.1

1.0.1.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws

29/10 2014

1.0.0

1.0.0.0 https://github.com/gfreeau/GfreeauGetJWTBundle

This Symfony2 bundle provides a security listener to return a JWT

  Sources   Download

MIT

The Requires

 

authentication jwt symfony2 bundle jws