Registry / auth / firebase-php-jwt

firebase-php-jwt

JSON →
library7.1.0phppackagistunverified

A simple library to encode and decode JSON Web Tokens (JWT) in PHP, conforming to the current spec.

composer require firebase/php-jwt
INSTALL
IMPORT
SIG · FIREBASE-PHP-JWT
F
firebase-php-jwt
authphpv7.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JWT
✓ use Firebase\JWT\JWT;

Encode and decode a JWT using HMAC-SHA256.

use Firebase\JWT\JWT; $key = 'example_key'; $payload = ['iss' => 'example.org', 'sub' => '1234567890']; $jwt = JWT::encode($payload, $key, 'HS256'); $decoded = JWT::decode($jwt, new \Firebase\JWT\Key($key, 'HS256'));
Debug
Known issues
breakingVersion 7.0+ uses Key objects instead of plain strings for decoding.
fix
Use new \Firebase\JWT\Key($key, $algorithm) instead of passing key as string.
affects: >=7.0
Upgrade
Version history
7.1.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
firebase-php-jwt — pip install firebase-php-jwt · libregistry