Registry / auth / lcobucci-jwt

lcobucci-jwt

JSON →
library5.6.0phppackagistunverified

A simple library to work with JSON Web Token and JSON Web Signature

composer require lcobucci/jwt
INSTALL
IMPORT
SIG · LCOBUCCI-JWT
L
lcobucci-jwt
authphpv5.6.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.

Builder
use Lcobucci\JWT\Builder;

Create a signed JWT token

use Lcobucci\JWT\Builder; use Lcobucci\JWT\Signer\Hmac\Sha256; $token = (new Builder()) ->issuedBy('http://example.com') ->permittedFor('http://example.org') ->identifiedBy('4f1g23a12aa', true) ->issuedAt(new DateTimeImmutable()) ->canOnlyBeUsedAfter(new DateTimeImmutable()) ->expiresAt((new DateTimeImmutable())->modify('+1 hour')) ->withClaim('uid', 1) ->getToken(new Sha256(), new Signer\Key('testing'));
Debug
Known issues
breakingBreaking changes between v4 and v5: Builder no longer implements __toString()
fix
Use ->toString() method instead of casting to string
affects: >=5.0.0
Upgrade
Version history
5.6.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
16
Resources
lcobucci-jwt — pip install lcobucci-jwt · libregistry