2017 © Pedro Peláez
 

library silex-jwt

Library for work with JWT on Silex framework

image

ofat/silex-jwt

Library for work with JWT on Silex framework

  • Thursday, November 24, 2016
  • by ofat
  • Repository
  • 1 Watchers
  • 0 Stars
  • 89 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 2 Versions
  • 31 % Grown

The README.md

Silex JWT

Library for work with JWT on Silex framework., (*1)

You can generate and check JWT tokens, use middleware for auth checking., (*2)

Installation

composer require ofat\silex-jwt, (*3)

Usage

  1. Register service provider:

```php <?php, (*4)

use Ofat\SilexJWT\JWTAuth; use Silex\Application;, (*5)

//Start our application $app = new Silex\Application();, (*6)

//Register silex jwt service provider. Add jwt secret key $app->register(new JWTAuth(),[ 'jwt.secret' => 'test' ]);, (*7)

//Example of jwt generating $app->post('/login', function(Request $request) use ($app) { $userId = 1; $token = $app['jwt_auth']->generateToken($userId);, (*8)

return $app->json(['token' => $token]);

});, (*9)

//Example of checking json web token $app->get('/test', function(Request $request) use ($app) { return $app->json(['test' => true]); })->before(new JWTTokenCheck()); `, (*10)

The Versions

24/11 2016

dev-master

9999999-dev

Library for work with JWT on Silex framework

  Sources   Download

MIT

The Requires

 

by Vitalii [ofat] Ofat

extension jwt silex

24/11 2016

v1.0.0

1.0.0.0

Library for work with JWT on Silex framework

  Sources   Download

MIT

The Requires

 

by Vitalii [ofat] Ofat

extension jwt silex