Multi-algorithm issuing
HS256, HS384, HS512 and RS256, with time leeway during validation.
JWT / PHP + Rust
Issue, verify, refresh and revoke through one core shared by plain PHP and six frameworks.
The core depends on no framework helper; config, logging, database and Redis connections are injected from outside, and the six adapters only wire the container.
All seven integration paths share one config shape; the blacklist switches between file, redis, database and memcached, with fail-open or fail-closed behavior on storage errors.
A flat cartoon Shiba Inu door guard: six gold studs on its collar stand for the six framework adapters, a gold key tag hangs from its neck, and a blue shield sits in the key bow.
Verify every request at the door.One core handles the whole token lifecycle.
HS256, HS384, HS512 and RS256, with time leeway during validation.
A refreshed token blacklists the old jti, so refresh tokens cannot be reused.
Switch between file, redis, database and memcached by config.
Native\Guard reads the Bearer token and returns a uniform 401 JSON response.
Each path has a middleware, filter or request guard.
Storage operations retry automatically; failures can fail open or closed.
Beyond PHP, the same JWT authentication is available in Rust.
Rust multi-framework JWT
JWT core with four algorithms, refresh rotation, four blacklist stores and nine integration paths.
Four key releases that added adapters and the project pet.
Fix the Memcached call-state assertion and rerun tests before release.
Wire 12 pet expressions into the Mascot API for direct use in code.
Finish the flat mascot, full expression set and social preview.
Add Yii2 and Yii3 adapters and fix a Yii2 dynamic-property auth crash.
Click an image to enlarge.
Install first, then run a minimal example.
composer require erikwang2013/jwt-webmanrequire __DIR__ . '/vendor/autoload.php';
use Erikwang2013\Jwt\Native\Guard;
$guard = Guard::fromFile(__DIR__ . '/config/jwt.php');
$payload = $guard->requireAuth();
$userId = $payload['user_id'];cargo add jwt-rustuse std::path::Path;
use jwt_rust::factory::JwtFactory;
let jwt = JwtFactory::from_file(Path::new("jwt.toml"))?;
let token = jwt.encode(&serde_json::json!({"user_id": 1}), None)?;
let payload = jwt.decode(&token)?;
let user_id = payload["user_id"].as_i64();On door duty, in twelve moods.