ekok/php-jwt

PHP JWT

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/ekok/php-jwt

v0.1.0 2022-03-28 06:17 UTC

This package is auto-updated.

Last update: 2025-09-28 13:59:19 UTC


README

Based on firebase/php-jwt

<?php

$options = array(
    'key' => 'mySecr3TKey~',
    // options defaults value
    // 'id' => null, // or jti
    // 'leeway' => 0,
    // 'keyId' => null,
    // 'publicKeys' => array(),
    // 'header' => array(),
    // 'algorithm' => null, // or alg
    // 'issuer' => null, // or iss
    // 'expires' => null, // or exp
    // 'subject' => null, // or sub
    // 'audience' => null, // or aud
    // 'notBefore' => null, // or nbf
    // 'issuedAt' => null, // or iat
);
$jwt = new Ekok\JWT\Manager($options);
$payload = array(
    'foo' => 'bar',
);
$token = $jwt->encode($payload);
$decoded = $jwt->decode($token);

// $decoded === $payload