phacman / php-jwt
Compact version: A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.
v1.1.0
2023-10-29 14:45 UTC
Requires
- php: >=8.1
- ext-openssl: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- guzzlehttp/guzzle: ^6.5||^7.4
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.5
Suggests
- ext-sodium: Support EdDSA (Ed25519) signatures
- paragonie/sodium_compat: Support EdDSA (Ed25519) signatures when libsodium is not present
README
A simple library to encode and decode JSON Web Tokens (JWT) in PHP, conforming to RFC 7519.
Getting Started
- base: docs/qa-base.php
- headers: docs/qa-headers.php
- openssl: docs/qa-openssl.php
- passphrase: docs/qa-passphrase.php
- EdDSA: docs/qa-eddsa.php
- multiple keys: docs/qa-multiple.php
- JWKs: docs/qa-jwks.php
- cached: docs/qa-cached.php
- exception: docs/qa-exception.php
- casting to array: docs/qa-casting.php
New Lines in private keys
If your private key contains \n
characters, be sure to wrap it in double quotes ""
and not single quotes ''
in order to properly interpret the escaped characters.
License
Resources
- Original repository: https://github.com/firebase/php-jwt