Skip to content

Evaneos/silex-jwt-provider

Repository files navigation

Silex JWT Provider

Silex provider for JWT.

⚠️ Deprecation notice

Silex has reached its end of life in June 2018 [ref].

We will only maintain this package for internal use only. Contributions are no longer accepted.

You are encouraged to use Symfony 4+ and alternatives like lexik/LexikJWTAuthenticationBundle or a custom authenticator.

Usage

<?php
  
use Evaneos\JWT\Silex\Provider\SecurityJWTServiceProvider;
use Silex\Provider\SecurityServiceProvider;
  
$app->register(new SecurityServiceProvider(), [
    'security.firewalls' => [
        'all' => [
            'stateless' => true,
            'pattern' => '^.*$',
            'jwt' => [
                'secret_key' => 'secret',
                'allowed_algorithms' => ['HS256'],
                'retrieval_strategy' => 'chain',
            ],
        ],
    ],
]);
  
$app->register(new SecurityJWTServiceProvider());