evaneos/silex-jwt-provider

There is no license information available for the latest version (v3.1.0) of this package.

Silex JWT Provider

v3.1.0 2021-10-12 08:14 UTC

This package is auto-updated.

Last update: 2024-04-12 13:55:42 UTC


README

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());